You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by GitBox <gi...@apache.org> on 2022/07/11 05:48:15 UTC

[GitHub] [incubator-seatunnel] gaaraG opened a new issue, #2156: [Bug] [connector-v2] When outputting data to clickhouse, a ClassCastException was encountered

gaaraG opened a new issue, #2156:
URL: https://github.com/apache/incubator-seatunnel/issues/2156

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/incubator-seatunnel/issues?q=is%3Aissue+label%3A%22bug%22) and found no similar issues.
   
   
   ### What happened
   
   A ClassCastException occurs when reading from clickhouse to clickhouse using Flink.
   In the field type mapping, it will be mapped according to the priority, according to the priority mapping to the wrong type, I changed the priority order of the mapping and later launched a PR
   
   ### SeaTunnel Version
   
   dev
   
   ### SeaTunnel Config
   
   ```conf
   env {
     execution.parallelism = 1
   }
   
   source {
     Clickhouse {
       host = "localhost:8123"
       database = "default"
       sql = "select * from uk_price_paid"
       username = "default"
       password = "6hGIAsc7" 
     }
   }
   
   transform {
   }
   
   sink {
     Clickhouse {
       host = "localhost:8123"
       database = "default"
       table = "uk_price_paid1"
       username = "default"
       password = "6hGIAsc7" 
     }
   }
   ```
   
   
   ### Running Command
   
   ```shell
   bin/start-seatunnel-flink-new-connector.sh -c config/flink.batch.conf
   ```
   
   
   ### Error Exception
   
   ```log
   java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Double
           at org.apache.seatunnel.connectors.seatunnel.clickhouse.sink.inject.DoubleInjectFunction.injectFields(DoubleInjectFunction.java:30)
           at org.apache.seatunnel.connectors.seatunnel.clickhouse.sink.client.ClickhouseSinkWriter.addIntoBatch(ClickhouseSinkWriter.java:146)
           at org.apache.seatunnel.connectors.seatunnel.clickhouse.sink.client.ClickhouseSinkWriter.write(ClickhouseSinkWriter.java:95)
           at org.apache.seatunnel.connectors.seatunnel.clickhouse.sink.client.ClickhouseSinkWriter.write(ClickhouseSinkWriter.java:56)
           at org.apache.seatunnel.translation.flink.sink.FlinkSinkWriter.write(FlinkSinkWriter.java:51)
           at org.apache.flink.streaming.runtime.operators.sink.AbstractSinkWriterOperator.processElement(AbstractSinkWriterOperator.java:80)
           at org.apache.flink.streaming.runtime.tasks.CopyingChainingOutput.pushToOperator(CopyingChainingOutput.java:71)
           at org.apache.flink.streaming.runtime.tasks.CopyingChainingOutput.collect(CopyingChainingOutput.java:46)
           at org.apache.flink.streaming.runtime.tasks.CopyingChainingOutput.collect(CopyingChainingOutput.java:26)
           at org.apache.flink.streaming.api.operators.CountingOutput.collect(CountingOutput.java:50)
           at org.apache.flink.streaming.api.operators.CountingOutput.collect(CountingOutput.java:28)
           at org.apache.flink.streaming.api.operators.StreamSourceContexts$ManualWatermarkContext.processAndCollect(StreamSourceContexts.java:317)
           at org.apache.flink.streaming.api.operators.StreamSourceContexts$WatermarkContext.collect(StreamSourceContexts.java:411)
           at org.apache.seatunnel.translation.flink.source.RowCollector.collect(RowCollector.java:45)
           at org.apache.seatunnel.translation.flink.source.RowCollector.collect(RowCollector.java:30)
           at org.apache.seatunnel.connectors.seatunnel.clickhouse.source.ClickhouseSourceReader.lambda$pollNext$0(ClickhouseSourceReader.java:82)
           at java.util.Iterator.forEachRemaining(Iterator.java:116)
           at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
           at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
           at org.apache.seatunnel.connectors.seatunnel.clickhouse.source.ClickhouseSourceReader.pollNext(ClickhouseSourceReader.java:76)
           at org.apache.seatunnel.translation.source.ParallelSource.run(ParallelSource.java:120)
           at org.apache.seatunnel.translation.flink.source.BaseSeaTunnelSourceFunction.run(BaseSeaTunnelSourceFunction.java:77)
           at org.apache.flink.streaming.api.operators.StreamSource.run(StreamSource.java:104)
           at org.apache.flink.streaming.api.operators.StreamSource.run(StreamSource.java:60)
           at org.apache.flink.streaming.runtime.tasks.SourceStreamTask$LegacySourceFunctionThread.run(SourceStreamTask.java:269)
   ```
   
   
   ### Flink or Spark Version
   
   flink v1.13.6
   
   ### Java or Scala Version
   
   java 1.8.0_212
   
   
   ### Screenshots
   
   
   ![image](https://user-images.githubusercontent.com/85996062/178196983-893b379c-3003-407e-b8a3-14b81c81aed8.png)
   
   ![image](https://user-images.githubusercontent.com/85996062/178196900-e5289f88-3d64-4f29-8c45-84b917174cdb.png)
   
   ![image](https://user-images.githubusercontent.com/85996062/178197040-8533cb5f-ced0-4908-95b3-bb9b7f03a33f.png)
   
   
   
   ### 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


[GitHub] [incubator-seatunnel] Hisoka-X closed issue #2156: [Bug] [connector-v2] When outputting data to clickhouse, a ClassCastException was encountered

Posted by GitBox <gi...@apache.org>.
Hisoka-X closed issue #2156: [Bug] [connector-v2] When outputting data to clickhouse, a ClassCastException was encountered
URL: https://github.com/apache/incubator-seatunnel/issues/2156


-- 
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


[GitHub] [incubator-seatunnel] Hisoka-X commented on issue #2156: [Bug] [connector-v2] When outputting data to clickhouse, a ClassCastException was encountered

Posted by GitBox <gi...@apache.org>.
Hisoka-X commented on issue #2156:
URL: https://github.com/apache/incubator-seatunnel/issues/2156#issuecomment-1181670562

   Close by #2160 


-- 
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