Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:support Apache Doris database connector #22836

Draft
wants to merge 4 commits into
base: devel
Choose a base branch
from

Conversation

liugddx
Copy link

@liugddx liugddx commented Feb 16, 2024

Apache Doris is a high-performance, real-time analytic database based on the MPP architecture and is known for its extreme speed and ease of use. It takes only sub-second response times to return query results under massive amounts of data, and can support not only highly concurrent point query scenarios, but also high-throughput complex analytic scenarios. This brief guide will show you how to download the latest stable version of Doris, install and run it on a single node, including creating databases, data tables, importing data and queries.

It uses mysql dialect.

@liugddx
Copy link
Author

liugddx commented Feb 17, 2024

@E1izabeth PTAL thanks

@E1izabeth
Copy link
Member

Thank you for contribution

@liugddx
Copy link
Author

liugddx commented Feb 19, 2024

Thank you for contribution

You're welcome. Is there anything else I need to do?

@E1izabeth
Copy link
Member

We will review your PR and let you know.

@LonwoLonwo
Copy link
Member

Hello @liugddx

Could you please change the background of the icons to transparent?
Like here: https://github.com/dbeaver/dbeaver/pull/22754/files
You could also do it for the logo, but the dark text will probably not look good in our dark theme. So, you can change the logo text and make the background transparent or leave the logo as is.

https://github.com/dbeaver/dbeaver/blob/devel/plugins/org.jkiss.dbeaver.ext.mysql/plugin.xml#L287
And you can add the logo like this. No need to add it as a Maria logo (please remove related code, including constant).

And the last one:

<parameter name="supports-partitions" value="false"/>
<parameter name="supports-references" value="false"/>
<parameter name="supports-triggers" value="false"/>
<parameter name="supports-events" value="false"/>
<parameter name="supports-users" value="false"/>
<parameter name="supports-charsets" value="false"/>
<parameter name="supports-collations" value="false"/>
<parameter name="supportsClients" value="false"/>

Are all these parameters correct? Dorris doesn't support partitions/triggers etc.

@liugddx
Copy link
Author

liugddx commented Feb 20, 2024

Hello @liugddx

Could you please change the background of the icons to transparent? Like here: https://github.com/dbeaver/dbeaver/pull/22754/files You could also do it for the logo, but the dark text will probably not look good in our dark theme. So, you can change the logo text and make the background transparent or leave the logo as is.

https://github.com/dbeaver/dbeaver/blob/devel/plugins/org.jkiss.dbeaver.ext.mysql/plugin.xml#L287 And you can add the logo like this. No need to add it as a Maria logo (please remove related code, including constant).

And the last one:

<parameter name="supports-partitions" value="false"/>
<parameter name="supports-references" value="false"/>
<parameter name="supports-triggers" value="false"/>
<parameter name="supports-events" value="false"/>
<parameter name="supports-users" value="false"/>
<parameter name="supports-charsets" value="false"/>
<parameter name="supports-collations" value="false"/>
<parameter name="supportsClients" value="false"/>

Are all these parameters correct? Dorris doesn't support partitions/triggers etc.

The partition of doris is different from that of mysql. https://doris.apache.org/docs/data-table/data-partition

@LonwoLonwo
Copy link
Member

The partition of doris is different from that of mysql. https://doris.apache.org/docs/data-table/data-partition

Okay. It is clear about partitions.
But I am waiting for other answers and changes

@liugddx
Copy link
Author

liugddx commented Feb 20, 2024

The partition of doris is different from that of mysql. https://doris.apache.org/docs/data-table/data-partition

Okay. It is clear about partitions.

But I am waiting for other answers and changes

I can provide this part of the ability in the next pr. I need to understand this part of the code.

@LonwoLonwo
Copy link
Member

I need to understand this part of the code.

What questions do you have? Is something unclear?

@liugddx
Copy link
Author

liugddx commented Feb 20, 2024

About the partition.

@LonwoLonwo
Copy link
Member

This parameter means that partitions will not shown in the database navigator tree. So, I asked - whether it was correct for your database or not. Now I see that this is correct.

And the last question - did you check your logo in the dark theme in DBeaver?

2024-02-20 17_20_38-Preferences

I don't think the dark text will look okay on the dark background.

@liugddx
Copy link
Author

liugddx commented Feb 21, 2024

This parameter means that partitions will not shown in the database navigator tree. So, I asked - whether it was correct for your database or not. Now I see that this is correct.

And the last question - did you check your logo in the dark theme in DBeaver?

2024-02-20 17_20_38-Preferences

I don't think the dark text will look okay on the dark background.

I will add it under this PR

  • doris partition support
  • doris index support
  • Theme support dark/light/custom

@liugddx liugddx marked this pull request as draft February 21, 2024 06:02
@liugddx
Copy link
Author

liugddx commented Feb 21, 2024

@LonwoLonwo Thanks for your review.

@LonwoLonwo LonwoLonwo self-assigned this Feb 21, 2024
@LonwoLonwo
Copy link
Member

I will add it under this PR

You can add partitions and indexes support as a separate PR if you want. For now, I'm waiting only for the correct logo for this PR.

@liugddx
Copy link
Author

liugddx commented Feb 21, 2024

I will add it under this PR

You can add partitions and indexes support as a separate PR if you want. For now, I'm waiting only for the correct logo for this PR.

I've tested it and the logo is displayed properly

@liugddx liugddx marked this pull request as ready for review February 21, 2024 12:34
@liugddx
Copy link
Author

liugddx commented Feb 22, 2024

image
image

@liugddx
Copy link
Author

liugddx commented Feb 22, 2024

image

@liugddx
Copy link
Author

liugddx commented Feb 22, 2024

image

@LonwoLonwo
Copy link
Member

Thanks for the images!

@liugddx
Copy link
Author

liugddx commented Feb 23, 2024

This is the data model of doris.
https://doris.apache.org/docs/data-table/data-model

@LonwoLonwo
Copy link
Member

Yeah, this table DDL is a working one. Thanks.

@uslss uslss self-assigned this Feb 23, 2024
@uslss
Copy link
Member

uslss commented Feb 23, 2024

  1. NPE appears on Create database action from connection context menu - New database cannot be created from UI
eclipse.buildId=unknown
java.version=17.0.6
java.vendor=Eclipse Adoptium
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en
Framework arguments:  -eclipse.keyring C:\Users\Dziyana\AppData\Roaming\DBeaverData\secure\secure_storage
Command-line arguments:  -os win32 -ws win32 -arch x86_64

org.jkiss.dbeaver.model
Error
Fri Feb 23 11:38:54 CET 2024
Cannot invoke "org.jkiss.dbeaver.ext.mysql.model.MySQLCharset.getDefaultCollation()" because "this.charset" is null

java.lang.NullPointerException: Cannot invoke "org.jkiss.dbeaver.ext.mysql.model.MySQLCharset.getDefaultCollation()" because "this.charset" is null
	at org.jkiss.dbeaver.ext.mysql.ui.views.MySQLCreateDatabaseDialog.createDialogArea(MySQLCreateDatabaseDialog.java:73)
	at org.jkiss.dbeaver.ext.mysql.ui.views.MySQLCreateDatabaseDialog.createDialogArea(MySQLCreateDatabaseDialog.java:1)
	at org.eclipse.jface.dialogs.Dialog.createContents(Dialog.java:767)
	at org.jkiss.dbeaver.ui.dialogs.BaseDialog.createContents(BaseDialog.java:74)
	at org.eclipse.jface.window.Window.create(Window.java:431)
	at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1094)
	at org.jkiss.dbeaver.ui.dialogs.BaseDialog.create(BaseDialog.java:89)
	at org.eclipse.jface.window.Window.open(Window.java:788)
	at org.jkiss.dbeaver.ext.mysql.ui.config.MySQLCatalogConfigurator.lambda$0(MySQLCatalogConfigurator.java:42)
	at org.jkiss.dbeaver.ui.UITask$1.runTask(UITask.java:42)
	at org.jkiss.dbeaver.ui.UITask.runWithResult(UITask.java:25)
	at org.jkiss.dbeaver.model.runtime.RunnableWithResult.run(RunnableWithResult.java:34)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:132)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4046)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3662)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.block(ModalContext.java:166)
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:368)
	at org.eclipse.ui.internal.WorkbenchWindow.lambda$7(WorkbenchWindow.java:2348)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
	at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2345)
	at org.jkiss.dbeaver.runtime.RunnableContextDelegate.run(RunnableContextDelegate.java:39)
	at org.jkiss.dbeaver.ui.UIUtils.runInProgressService(UIUtils.java:1888)
	at org.jkiss.dbeaver.ui.navigator.actions.NavigatorHandlerObjectCreateBase.createDatabaseObject(NavigatorHandlerObjectCreateBase.java:186)
	at org.jkiss.dbeaver.ui.navigator.actions.NavigatorHandlerObjectCreateBase.createNewObject(NavigatorHandlerObjectCreateBase.java:167)
	at org.jkiss.dbeaver.ui.navigator.actions.NavigatorHandlerObjectCreateNew.execute(NavigatorHandlerObjectCreateNew.java:135)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:283)
	at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:99)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:298)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:232)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:174)
	at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:165)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:488)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:485)
	at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:213)
	at org.eclipse.ui.internal.handlers.LegacyHandlerService.executeCommand(LegacyHandlerService.java:389)
	at org.jkiss.dbeaver.ui.ActionUtils.runCommand(ActionUtils.java:374)
	at org.jkiss.dbeaver.ui.navigator.actions.NavigatorHandlerObjectCreateNew.execute(NavigatorHandlerObjectCreateNew.java:127)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:283)
	at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:99)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:298)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:232)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:174)
	at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:165)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:488)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:485)
	at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:213)
	at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.executeItem(HandledContributionItem.java:438)
	at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.handleWidgetSelection(AbstractContributionItem.java:449)
	at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.lambda$2(AbstractContributionItem.java:475)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4273)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1066)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4071)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3659)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1155)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:342)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:648)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:342)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:555)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173)
	at org.jkiss.dbeaver.ui.app.standalone.DBeaverApplication.start(DBeaverApplication.java:290)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:402)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:665)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:602)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1486)

  1. Cannot save table created from UI due to an error (Simple table with 1 varchar column)
    image
    Also, this issue blocks export/import of the new table to DB
    image

  2. Cannot add column to existing table
    image
    and constraintsa
    image
    and indexes
    image

  3. Empty source for New View. Usually we use some template. For example. how it looks for SQLite
    image

and for Doris at the moment:
image

  1. Function cannot be created from UI due to error:
    generated script:
    image
    Error on save:
    image

BTW, are Procedures supported?

@liugddx
Copy link
Author

liugddx commented Feb 23, 2024

  1. NPE appears on Create database action from connection context menu - New database cannot be created from UI
eclipse.buildId=unknown
java.version=17.0.6
java.vendor=Eclipse Adoptium
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en
Framework arguments:  -eclipse.keyring C:\Users\Dziyana\AppData\Roaming\DBeaverData\secure\secure_storage
Command-line arguments:  -os win32 -ws win32 -arch x86_64

org.jkiss.dbeaver.model
Error
Fri Feb 23 11:38:54 CET 2024
Cannot invoke "org.jkiss.dbeaver.ext.mysql.model.MySQLCharset.getDefaultCollation()" because "this.charset" is null

java.lang.NullPointerException: Cannot invoke "org.jkiss.dbeaver.ext.mysql.model.MySQLCharset.getDefaultCollation()" because "this.charset" is null
	at org.jkiss.dbeaver.ext.mysql.ui.views.MySQLCreateDatabaseDialog.createDialogArea(MySQLCreateDatabaseDialog.java:73)
	at org.jkiss.dbeaver.ext.mysql.ui.views.MySQLCreateDatabaseDialog.createDialogArea(MySQLCreateDatabaseDialog.java:1)
	at org.eclipse.jface.dialogs.Dialog.createContents(Dialog.java:767)
	at org.jkiss.dbeaver.ui.dialogs.BaseDialog.createContents(BaseDialog.java:74)
	at org.eclipse.jface.window.Window.create(Window.java:431)
	at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1094)
	at org.jkiss.dbeaver.ui.dialogs.BaseDialog.create(BaseDialog.java:89)
	at org.eclipse.jface.window.Window.open(Window.java:788)
	at org.jkiss.dbeaver.ext.mysql.ui.config.MySQLCatalogConfigurator.lambda$0(MySQLCatalogConfigurator.java:42)
	at org.jkiss.dbeaver.ui.UITask$1.runTask(UITask.java:42)
	at org.jkiss.dbeaver.ui.UITask.runWithResult(UITask.java:25)
	at org.jkiss.dbeaver.model.runtime.RunnableWithResult.run(RunnableWithResult.java:34)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:132)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4046)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3662)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.block(ModalContext.java:166)
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:368)
	at org.eclipse.ui.internal.WorkbenchWindow.lambda$7(WorkbenchWindow.java:2348)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
	at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2345)
	at org.jkiss.dbeaver.runtime.RunnableContextDelegate.run(RunnableContextDelegate.java:39)
	at org.jkiss.dbeaver.ui.UIUtils.runInProgressService(UIUtils.java:1888)
	at org.jkiss.dbeaver.ui.navigator.actions.NavigatorHandlerObjectCreateBase.createDatabaseObject(NavigatorHandlerObjectCreateBase.java:186)
	at org.jkiss.dbeaver.ui.navigator.actions.NavigatorHandlerObjectCreateBase.createNewObject(NavigatorHandlerObjectCreateBase.java:167)
	at org.jkiss.dbeaver.ui.navigator.actions.NavigatorHandlerObjectCreateNew.execute(NavigatorHandlerObjectCreateNew.java:135)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:283)
	at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:99)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:298)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:232)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:174)
	at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:165)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:488)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:485)
	at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:213)
	at org.eclipse.ui.internal.handlers.LegacyHandlerService.executeCommand(LegacyHandlerService.java:389)
	at org.jkiss.dbeaver.ui.ActionUtils.runCommand(ActionUtils.java:374)
	at org.jkiss.dbeaver.ui.navigator.actions.NavigatorHandlerObjectCreateNew.execute(NavigatorHandlerObjectCreateNew.java:127)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:283)
	at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:99)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:298)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:232)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:174)
	at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:165)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:488)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:485)
	at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:213)
	at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.executeItem(HandledContributionItem.java:438)
	at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.handleWidgetSelection(AbstractContributionItem.java:449)
	at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.lambda$2(AbstractContributionItem.java:475)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4273)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1066)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4071)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3659)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1155)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:342)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:648)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:342)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:555)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173)
	at org.jkiss.dbeaver.ui.app.standalone.DBeaverApplication.start(DBeaverApplication.java:290)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:402)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:665)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:602)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1486)
  1. Cannot save table created from UI due to an error (Simple table with 1 varchar column)
    image
    Also, this issue blocks export/import of the new table to DB
    image
  2. Cannot add column to existing table
    image
    and constraintsa
    image
    and indexes
    image
  3. Empty source for New View. Usually we use some template. For example. how it looks for SQLite
    image

and for Doris at the moment: image

  1. Function cannot be created from UI due to error:
    generated script:
    image
    Error on save:
    image

BTW, are Procedures supported?

Do I need to solve the above problems in the current PR? Is it possible to split PR to do these things?

@LonwoLonwo
Copy link
Member

Do I need to solve the above problems in the current PR? Is it possible to split PR to do these things?

At least NPE you need to solve here, in this PR. Other issues can be fixed in other PRs.

@liugddx
Copy link
Author

liugddx commented Feb 26, 2024

Do I need to solve the above problems in the current PR? Is it possible to split PR to do these things?

At least NPE you need to solve here, in this PR. Other issues can be fixed in other PRs.

The null pointer is due to doris not supporting SHOW CHARSET syntax, this is the fixed pr apache/doris#31389. In addition, the statement used by Doris to create a database is create database instead of create schema. I will fix this problem in other PR.

@liugddx
Copy link
Author

liugddx commented Feb 27, 2024

Do I need to solve the above problems in the current PR? Is it possible to split PR to do these things?

At least NPE you need to solve here, in this PR. Other issues can be fixed in other PRs.

The null pointer is due to doris not supporting SHOW CHARSET syntax, this is the fixed pr apache/doris#31389. In addition, the statement used by Doris to create a database is create database instead of create schema. I will fix this problem in other PR.

@LonwoLonwo Hi, is this explanation okay? All functions are fine in console.

@LonwoLonwo
Copy link
Member

The null pointer is due to doris not supporting SHOW CHARSET syntax, this is the fixed pr apache/doris#31389. In addition, the statement used by Doris to create a database is create database instead of create schema. I will fix this problem in other PR.

We can't implement not working functionality. We can ignore some small or complex implementations, but here is just NPE and our main functionality. So, you need to fix this in this PR.

@liugddx
Copy link
Author

liugddx commented Feb 27, 2024

The null pointer is due to doris not supporting SHOW CHARSET syntax, this is the fixed pr apache/doris#31389. In addition, the statement used by Doris to create a database is create database instead of create schema. I will fix this problem in other PR.

We can't implement not working functionality. We can ignore some small or complex implementations, but here is just NPE and our main functionality. So, you need to fix this in this PR.

With the latest doris version, the null pointer exception has been fixed.

@LonwoLonwo
Copy link
Member

And how soon will the release with the fix be available?

@liugddx
Copy link
Author

liugddx commented Feb 27, 2024

And how soon will the release with the fix be available?

Probably at the end of March, But you can directly use the master branch for testing.

@liugddx
Copy link
Author

liugddx commented Feb 27, 2024

And how soon will the release with the fix be available?

Another point, since the syntax for creating a database in Doris is create database instead of create schema, I just solved the NPE.

@liugddx
Copy link
Author

liugddx commented Feb 27, 2024

schema

I found starrocks had the same problem.

@LonwoLonwo
Copy link
Member

I found starrocks had the same problem.

No, I can't reproduce it in DBeaver with the latest StarRocks.

Another point, since the syntax for creating a database in Doris is create database instead of create schema, I just solved the NPE.

Ok, it can be a special parameter. Like dataSource.isMariaDB(). To create schemas instead of databases.

@liugddx
Copy link
Author

liugddx commented Feb 28, 2024

I found starrocks had the same problem.

No, I can't reproduce it in DBeaver with the latest StarRocks.

Another point, since the syntax for creating a database in Doris is create database instead of create schema, I just solved the NPE.

Ok, it can be a special parameter. Like dataSource.isMariaDB(). To create schemas instead of databases.

Okay, does this also need to be repaired in this pr?

@LonwoLonwo
Copy link
Member

Okay, does this also need to be repaired in this pr?

Yes. Please implement it in this PR.

@liugddx
Copy link
Author

liugddx commented Feb 29, 2024

image PTAL @LonwoLonwo

@liugddx
Copy link
Author

liugddx commented Mar 5, 2024

image PTAL @LonwoLonwo

@LonwoLonwo Kindly pin. Can you help me drive PR?

appendDatabaseModifiers(catalog, script);
final StringBuilder script;
if (catalog.getDataSource().isDoris()) {
script = new StringBuilder("CREATE DATABASE `" + catalog.getName() + "`");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And how about the DROP and ALTER statements in this class?

@@ -64,8 +64,14 @@ protected MySQLCatalog createDatabaseObject(DBRProgressMonitor monitor, DBEComma
protected void addObjectCreateActions(DBRProgressMonitor monitor, DBCExecutionContext executionContext, List<DBEPersistAction> actions, ObjectCreateCommand command, Map<String, Object> options)
{
final MySQLCatalog catalog = command.getObject();
final StringBuilder script = new StringBuilder("CREATE SCHEMA `" + catalog.getName() + "`");
appendDatabaseModifiers(catalog, script);
final StringBuilder script;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please reformat this code please.
Because we are not using quotes anymore, we have a special function.
So, it will be

String catalogName = DBUtils.getQuotedIdentifier(catalog);
...
new StringBuilder("CREATE DATABASE " + catalogName);
...
new StringBuilder("CREATE SCHEMA " + catalogName);

@LonwoLonwo
Copy link
Member

And now you have the isDoris() method, which can help you to fix NPE, wdyt?

@LonwoLonwo
Copy link
Member

Hello @liugddx

Do you have any questions about the last review comments? Would you like any help from us?

@liugddx
Copy link
Author

liugddx commented Apr 4, 2024

NPE has been fixed.

@liugddx liugddx marked this pull request as draft April 7, 2024 01:44
@liugddx
Copy link
Author

liugddx commented Apr 7, 2024

NPE has been fixed.

This PR is temporarily suspended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants