oceanbase / odc

OceanBase Developer Center(ODC), An open-source, enterprise-grade database tool for collaborative development
https://github.com/oceanbase/odc
Apache License 2.0
540 stars 56 forks source link

[Bug]: failed to export result set #3765

Open yhilmare opened 3 weeks ago

yhilmare commented 3 weeks ago

ODC version

4.3.2

OB version

not related

What happened?

I type a query and try to export the result set of it

select *,utl_raw.cast_to_varchar2(DBMS_LOB.SUBSTR(RETMESSAGE,2000,1)) from bj_hxlog where def1 = 'QUERY_PUB' and TRANDATE like '%2024-10-25%'  order by TRANDATE desc ;

and I failed to export this query, the exception is as follow:

截屏2024-10-30 20 31 26
2024-10-30 20:28:23 [INFO] Result set export task starts, working directory:data/RESULT_SET/1000183
2024-10-30 20:28:23 [WARN] Error occurred when start task.
com.oceanbase.odc.core.shared.exception.OBException: Query result metadata failed, please try again, message=SQLException: ORA-00900: invalid SQL statement
    at com.oceanbase.odc.core.shared.exception.OBException.executeFailed(OBException.java:69) ~[odc-core-4.3.2-20241017.jar!/:?]
    at com.oceanbase.odc.service.resultset.ResultSetExportTask.setColumnConfig(ResultSetExportTask.java:263) ~[odc-service-4.3.2-20241017.jar!/:?]
    at com.oceanbase.odc.service.resultset.ResultSetExportTask.convertParam2TransferConfig(ResultSetExportTask.java:217) ~[odc-service-4.3.2-20241017.jar!/:?]
    at com.oceanbase.odc.service.resultset.ResultSetExportTask.<init>(ResultSetExportTask.java:113) ~[odc-service-4.3.2-20241017.jar!/:?]
    at com.oceanbase.odc.service.resultset.DumperResultSetExportTaskManager.start(DumperResultSetExportTaskManager.java:137) ~[odc-service-4.3.2-20241017.jar!/:?]
    at com.oceanbase.odc.service.resultset.ResultSetExportFlowableTask.start(ResultSetExportFlowableTask.java:57) ~[odc-service-4.3.2-20241017.jar!/:?]
    at com.oceanbase.odc.service.resultset.ResultSetExportFlowableTask.start(ResultSetExportFlowableTask.java:35) ~[odc-service-4.3.2-20241017.jar!/:?]
    at com.oceanbase.odc.service.flow.task.BaseODCFlowTaskDelegate.lambda$initCallable$1(BaseODCFlowTaskDelegate.java:236) ~[odc-service-4.3.2-20241017.jar!/:?]
    at com.oceanbase.odc.service.flow.task.BaseRuntimeFlowableDelegate.run(BaseRuntimeFlowableDelegate.java:128) ~[odc-service-4.3.2-20241017.jar!/:?]
    at com.oceanbase.odc.service.flow.task.BaseODCFlowTaskDelegate.run(BaseODCFlowTaskDelegate.java:164) ~[odc-service-4.3.2-20241017.jar!/:?]
    at com.oceanbase.odc.core.flow.BaseFlowableDelegate.execute(BaseFlowableDelegate.java:47) ~[odc-core-4.3.2-20241017.jar!/:?]
    at com.oceanbase.odc.service.flow.task.BaseRuntimeFlowableDelegate.execute(BaseRuntimeFlowableDelegate.java:144) ~[odc-service-4.3.2-20241017.jar!/:?]
    at com.oceanbase.odc.service.flow.task.FlowTaskSubmitter.lambda$execute$2(FlowTaskSubmitter.java:86) ~[odc-service-4.3.2-20241017.jar!/:?]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_422]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_422]
    at com.oceanbase.odc.common.trace.TraceDecorator.lambda$decorate$0(TraceDecorator.java:40) ~[odc-common-4.3.2-20241017.jar!/:?]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_422]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_422]
    at java.lang.Thread.run(Thread.java:750) [?:1.8.0_422]

What did you expect to happen?

export the result set normally

How can we reproduce it (as minimally and precisely as possible)?

  1. prepare a table:

    CREATE TABLE "BJ_HXLOG" (
    "PK_BJ_HXLOG" CHAR(20) CONSTRAINT "BJ_HXLOG_OBNOTNULL_1704276125686593" NOT NULL ENABLE,
    "CONSUMERSEQNO" VARCHAR2(100),
    "SENDMESSAGE" BLOB,
    "RETCODE" VARCHAR2(100),
    "DEF1" VARCHAR2(202),
    "RETMESSAGE" BLOB,
    "DEF2" VARCHAR2(202),
    "DEF3" VARCHAR2(512),
    "DEF4" VARCHAR2(202),
    "DEF5" VARCHAR2(202),
    "SERVICECODE" VARCHAR2(100),
    "TRANDATE" VARCHAR2(100),
    "TRANTIMESTAMP" VARCHAR2(100),
    "CODEBATCH" VARCHAR2(100),
    "VBILLNO" VARCHAR2(100),
    "PK_GROUP" VARCHAR2(40) DEFAULT '~',
    "PK_ORG" VARCHAR2(40) DEFAULT '~',
    "PK_ORG_V" VARCHAR2(40) DEFAULT '~',
    "ORGCODE" VARCHAR2(100),
    "CREATOR" VARCHAR2(40) DEFAULT '~',
    "CREATIONTIME" CHAR(19),
    "MODIFIER" VARCHAR2(40) DEFAULT '~',
    "MODIFIEDTIME" CHAR(19),
    "CODE" VARCHAR2(100),
    "NAME" VARCHAR2(100),
    "TS" CHAR(19),
    "DR" NUMBER(*,0) DEFAULT 0
    ) COMPRESS FOR ARCHIVE REPLICA_NUM = 1 BLOCK_SIZE = 16384 USE_BLOOM_FILTER = FALSE TABLET_SIZE = 134217728 PCTFREE = 0;
  2. mock data on this table, remember the col DEF1 should be set to 'QUERY_PUB' and the col TRANDATE should be a random date value (from 2024-10-20 ~ 2024-10-31)

Anything else we need to know?

No response

LuckyPickleZZ commented 3 weeks ago

This would be fixed after upgrading ob-loader-dumper to 4.3.x