You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "Xuzhengz (via GitHub)" <gi...@apache.org> on 2025/01/06 02:10:15 UTC

[I] [Bug] [transform-sql] expressionItem get error [seatunnel]

Xuzhengz opened a new issue, #8458:
URL: https://github.com/apache/seatunnel/issues/8458

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22bug%22) and found no similar issues.
   
   
   ### What happened
   
   当原表存在数字开头的字段名称时,例如1级分类、2级分类,sql引擎解析后会变成 两个级分类,导致字段名称重复
   
   ### SeaTunnel Version
   
   2.3.8 和 dev
   
   ### SeaTunnel Config
   
   ```conf
   # Defining the runtime environment
   env {
     parallelism = 1
     job.mode = "BATCH"
   }
   source {
     Jdbc {
       url = "jdbc:mysql://172.16.8.131:3306/testa?serverTimezone=GMT%2b8&useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true"
       driver = "com.mysql.cj.jdbc.Driver"
       connection_check_timeout_sec = 100
       user = "mysql"
       password = "******"
       query = "select * from 2022年全年案件"
       result_table_name = "source"
     }
   }
   
   transform {
     # If you would like to get more information about how to configure seatunnel and see full list of transform plugins,
     # please go to https://seatunnel.apache.org/docs/transform-v2/sql
     Sql {
       query = "select 1级分类,2级分类 from source"
       result_table_name = "sql"
       source_table_name = ["source"]
     }
   }
   
   sink {
     Console {
       source_table_name = ["sql"]
     }
   }
   ```
   
   
   ### Running Command
   
   ```shell
   bin/seatunnel.sh -c demo.json
   ```
   
   
   ### Error Exception
   
   ```log
   Exception in thread "main" org.apache.seatunnel.core.starter.exception.CommandExecuteException: SeaTunnel job executed failed
   	at org.apache.seatunnel.core.starter.seatunnel.command.ClientExecuteCommand.execute(ClientExecuteCommand.java:213)
   	at org.apache.seatunnel.core.starter.SeaTunnel.run(SeaTunnel.java:40)
   	at org.apache.seatunnel.example.engine.SeaTunnelEngineExample.main(SeaTunnelEngineExample.java:43)
   Caused by: org.apache.seatunnel.api.table.factory.FactoryException: ErrorCode:[API-06], ErrorDescription:[Factory initialize failed] - Unable to create a sink for identifier 'Console'.
   	at org.apache.seatunnel.api.table.factory.FactoryUtil.createAndPrepareSink(FactoryUtil.java:142)
   	at org.apache.seatunnel.engine.core.parse.MultipleTableJobConfigParser.createSinkAction(MultipleTableJobConfigParser.java:665)
   	at org.apache.seatunnel.engine.core.parse.MultipleTableJobConfigParser.parseSink(MultipleTableJobConfigParser.java:596)
   	at org.apache.seatunnel.engine.core.parse.MultipleTableJobConfigParser.parse(MultipleTableJobConfigParser.java:221)
   	at org.apache.seatunnel.engine.client.job.ClientJobExecutionEnvironment.getLogicalDag(ClientJobExecutionEnvironment.java:114)
   	at org.apache.seatunnel.engine.client.job.ClientJobExecutionEnvironment.execute(ClientJobExecutionEnvironment.java:182)
   	at org.apache.seatunnel.core.starter.seatunnel.command.ClientExecuteCommand.execute(ClientExecuteCommand.java:160)
   	... 2 more
   Caused by: org.apache.seatunnel.common.utils.SeaTunnelException: Table testa.2022年全年案件 field 级分类 duplicate
   	at org.apache.seatunnel.api.table.factory.TableFactoryContext.checkCatalogTableIllegal(TableFactoryContext.java:54)
   	at org.apache.seatunnel.api.table.factory.TableSinkFactoryContext.<init>(TableSinkFactoryContext.java:40)
   	at org.apache.seatunnel.api.table.factory.TableSinkFactoryContext.replacePlaceholderAndCreate(TableSinkFactoryContext.java:53)
   	at org.apache.seatunnel.api.table.factory.FactoryUtil.createAndPrepareSink(FactoryUtil.java:126)
   	... 8 more
   ```
   
   
   ### Zeta or Flink or Spark Version
   
   2.3.8
   
   ### Java or Scala Version
   
   1.8
   
   ### Screenshots
   
   ![ef0855ae306446f357c7be3f056a4b1](https://github.com/user-attachments/assets/1a224fce-132c-4390-9284-a001adc91e63)
   ![3957b1578973b7619f91bbe832b6868](https://github.com/user-attachments/assets/ef73454d-e3eb-4eef-a87d-51c519ca8435)
   
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] [transform-sql] expressionItem get error [seatunnel]

Posted by "Xuzhengz (via GitHub)" <gi...@apache.org>.
Xuzhengz closed issue #8458: [Bug] [transform-sql] expressionItem get error
URL: https://github.com/apache/seatunnel/issues/8458


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] [transform-sql] expressionItem get error [seatunnel]

Posted by "CosmosNi (via GitHub)" <gi...@apache.org>.
CosmosNi commented on issue #8458:
URL: https://github.com/apache/seatunnel/issues/8458#issuecomment-2572636766

   2.3.9 solved the problem


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] [transform-sql] expressionItem get error [seatunnel]

Posted by "Xuzhengz (via GitHub)" <gi...@apache.org>.
Xuzhengz commented on issue #8458:
URL: https://github.com/apache/seatunnel/issues/8458#issuecomment-2572881811

   > 2.3.9 solved the problem
   
   thanks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org