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

   ### 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
   
   Since it is necessary to adapt to the CDH version of Hive ,I created a 
connector by copying the official connector named connector-hive, and the 
copied connector is named connector-hivecdh. I only modified the hive-exec 
driver version to 2.1.1-cdh6.3.2 and changed HiveConstants in HiveConstants to 
Hivecdh. Then, I tried to package this connector using the command mvn clean 
package -pl seatunnel-connectors-v2/connector-hivecdh -am -DskipTests, but the 
tests failed. I also tried compiling the entire project with the source code 
compilation command mvn clean package -pl seatunnel-dist -am 
-Dmaven.test.skip=true, but the tests still failed. However, if I modify the 
original connector-hive by only changing the hive-exec driver version to 
2.1.1-cdh6.3.2, it works fine and can connect to the CDH version of Hive 
normally. Please provide the correct way to create a custom connector. The 
hive-exec-2.1.1-cdh6.3.2 driver is already stored in the lib directory under 
the Seatunnel project dir
 ectory.  the same issue exists in version 2.3.9 , Thank you.
   
   由于需要适配cdh版本的hive   我创建了一个连接器,复制了官方的连接器connector-hive 
,复制的连接器名称为connector-hivecdh , 只是将hive-exec 驱动版本修改为2.1.1-cdh6.3.2 
,并且将HiveConstants 中的HiveConstants 修改为Hivecdh ,然后通过命令mvn clean package -pl 
seatunnel-connectors-v2/connector-hivecdh -am 
-DskipTests打包这个连接器,测试不通过,通过源码编译命令编译mvn clean package -pl seatunnel-dist -am 
-Dmaven.test.skip=true整个项目,还是测试不通过,但是如果在原连接器connector-hive上修改,只是将hive-exec 
驱动版本修改为2.1.1-cdh6.3.2 
,是可以正常连接到cdh版本的hive的,seatunnel项目目录下的lib目录下已经存放了hive-exec-2.1.1-cdh6.3.2 驱动 
,2.3.9版本存在同样的问题 ,请给予我一些帮助可以正确创建连接器, 谢谢
   
   ### SeaTunnel Version
   
   2.3.8
   
   ### SeaTunnel Config
   
   ```conf
   {
       "env" : {
           "job.mode" : "BATCH",
           "parallelism" : 5
       },
       "source" : [
           {
               "plugin_name" : "Jdbc",
               "connection_check_timeout_sec" : 100,
               "driver" : "com.mysql.cj.jdbc.Driver",
               "password" : "123456",
               "query" : "select user_id,CURRENT_TIMESTAMP as last_time  from 
sea_test.user",
               "table_path" : "sea_test.user",
               "url" : 
"jdbc:mysql://192.168.8.38:3306/sea_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8",
               "user" : "root"
           }
       ],
       "sink" :[
           {
               "plugin_name" : "hivecdh",
               "table_name" : "default.user_time",
               "metastore_uri" : "thrift://server002:9083",
               "hdfs_site_path":"/etc/hive/conf.cloudera.hive/hdfs-site.xml",
               "hive_site_path":"/etc/hive/conf.cloudera.hive/hive-site.xml"
           }
       ]
   }
   ```
   
   ### Running Command
   
   ```shell
   ./bin/seatunnel.sh --config ./config/testmysql2hive.json -m local
   ```
   
   ### Error Exception
   
   ```log
   2025-02-14 15:11:26,197 ERROR [o.a.s.c.s.SeaTunnel           ] [main] - 
Exception 
StackTrace: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.core.starter.seatunnel.SeaTunnelClient.main(SeaTunnelClient.java:34)
   Caused by: java.lang.RuntimeException: Plugin 
PluginIdentifier{engineType='seatunnel', pluginType='sink', 
pluginName='hivecdh'} not found.
           at 
org.apache.seatunnel.plugin.discovery.AbstractPluginDiscovery.createPluginInstance(AbstractPluginDiscovery.java:237)
           at 
org.apache.seatunnel.engine.core.parse.ConnectorInstanceLoader.loadSinkInstance(ConnectorInstanceLoader.java:77)
           at 
org.apache.seatunnel.engine.core.parse.JobConfigParser.parseSink(JobConfigParser.java:161)
           at 
org.apache.seatunnel.engine.core.parse.JobConfigParser.parseSinks(JobConfigParser.java:137)
           at 
org.apache.seatunnel.engine.core.parse.MultipleTableJobConfigParser.parseSink(MultipleTableJobConfigParser.java:560)
           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)
   ```
   
   ### Zeta or Flink or Spark Version
   
   Zeta 2.3.8
   
   ### Java or Scala Version
   
   java 8
   
   ### Screenshots
   
   
![Image](https://github.com/user-attachments/assets/7982e4d4-8c81-4f22-8bf6-1d0e3fe37d42)
   
   
![Image](https://github.com/user-attachments/assets/95415076-a012-4415-9ba9-78904d1105e6)
   
   
![Image](https://github.com/user-attachments/assets/56b68d7d-f609-4852-8060-f60763c0031e)
   
   
![Image](https://github.com/user-attachments/assets/702fa83e-2d3a-4a82-9ef9-fd3d49faaa88)
   
   ### Are you willing to submit PR?
   
   - [ ] 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to