You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/06/30 00:47:30 UTC

[GitHub] [hudi] txl2017 opened a new issue, #6007: spark query partition field error

txl2017 opened a new issue, #6007:
URL: https://github.com/apache/hudi/issues/6007

   **_Tips before filing an issue_**
   
   - Have you gone through our [FAQs](https://hudi.apache.org/learn/faq/)?
   
   - Join the mailing list to engage in conversations and get faster support at dev-subscribe@hudi.apache.org.
   
   - If you have triaged this as a bug, then file an [issue](https://issues.apache.org/jira/projects/HUDI/issues) directly.
   
   **Describe the problem you faced**
   
   A clear and concise description of the problem.
   
   **To Reproduce**
   
   Steps to reproduce the behavior:
   
   1. use flinkstreamer api write a table
   2. partition field is systemdate and use yyyyMMdd format
   3. sync hive use `dt` and dt is not a field in data
   4. use hive、flink、spark query data with dt=20220629, then spark got an error  "org.apache.spark.sql.AnalysisException: cannot resolve '`dt`' given input columns",hive and flink is ok
   
   **Expected behavior**
   
   A clear and concise description of what you expected to happen.
   
   **Environment Description**
   
   * Hudi version :
   0.11.0
   * Spark version :
   3.1.2
   * Hive version :
   2.11
   * Hadoop version :
   3.0.0
   * Storage (HDFS/S3/GCS..) :
   HDFS
   * Running on Docker? (yes/no) :
   no
   **Additional context**
   
   Add any other context about the problem here.
   
   **Stacktrace**
   
   ```Add the stacktrace of the error.```
   
   


-- 
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@hudi.apache.org.apache.org

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


[GitHub] [hudi] yihua commented on issue #6007: spark query partition field error

Posted by GitBox <gi...@apache.org>.
yihua commented on issue #6007:
URL: https://github.com/apache/hudi/issues/6007#issuecomment-1175779565

   cc @minihippo 


-- 
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@hudi.apache.org

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


[GitHub] [hudi] txl2017 commented on issue #6007: spark query partition field error

Posted by GitBox <gi...@apache.org>.
txl2017 commented on issue #6007:
URL: https://github.com/apache/hudi/issues/6007#issuecomment-1172021461

   > @txl2017 could you also provide the full commands for Hive sync and spark-submit/spark-shell for reproducing the issue?
   
   'partition-path-field'='systemdate'
   'keygen-class'='ComplexTimeKeyGenerator'
   'hive-sync-partition-extractor-class'='org.apache.hudi.hive.MultiPartKeysValueExtractor',
   systemdate format is yyyyMMdd HH:mm:ss like '2022-06-29 12:00:00', and partition format is yyyyMMdd.
   with this config sync to hive, use hive、flink、spark query hive ro table with systemdate=20220629, hive and flink hit the right result,
   but spark return nothing, then we delete  the systemdate=20220629 condition, the result return with systemdate='2022-06-29 12:00:00', not '20220629', so i think it's the reason why spark use systemdate=20220629 hit nothing.
   
   
   
   


-- 
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@hudi.apache.org

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


[GitHub] [hudi] yihua commented on issue #6007: spark query partition field error

Posted by GitBox <gi...@apache.org>.
yihua commented on issue #6007:
URL: https://github.com/apache/hudi/issues/6007#issuecomment-1171775912

   @txl2017 could you also provide the full commands for Hive sync and spark-submit/spark-shell for reproducing the issue?


-- 
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@hudi.apache.org

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


[GitHub] [hudi] txl2017 commented on issue #6007: spark query partition field error

Posted by GitBox <gi...@apache.org>.
txl2017 commented on issue #6007:
URL: https://github.com/apache/hudi/issues/6007#issuecomment-1172032212

   > > @txl2017 could you also provide the full commands for Hive sync and spark-submit/spark-shell for reproducing the issue?
   > 
   > 'partition-path-field'='systemdate' 'keygen-class'='ComplexTimeKeyGenerator' 'hive-sync-partition-extractor-class'='org.apache.hudi.hive.MultiPartKeysValueExtractor', systemdate format is yyyyMMdd HH:mm:ss like '2022-06-29 12:00:00', and partition format is yyyyMMdd. with this config sync to hive, use hive、flink、spark query hive ro table with systemdate=20220629, hive and flink hit the right result, but spark return nothing, then we delete the systemdate=20220629 condition, the result return with systemdate='2022-06-29 12:00:00', not '20220629', so i think it's the reason why spark use systemdate=20220629 hit nothing.
   
   after that, we try another way to avoid this. 
   we change the hudi  source code in StreamWriteOperatorCoordinator class
     private void initHiveSync() {
       this.hiveSyncExecutor = NonThrownExecutor.builder(LOG).waitForTasksFinish(true).build();
       if(ZvosComplexTimeKeyGenerator.class.getName().equals(conf.getString(FlinkOptions.KEYGEN_CLASS_NAME))){
         conf.set(FlinkOptions.PARTITION_PATH_FIELD, "dt");
       }
       this.hiveSyncContext = HiveSyncContext.create(conf);
     }
   update the partition field to 'dt' when sync to hive.
   with this case , spark got an error "org.apache.spark.sql.AnalysisException: cannot resolve 'dt' given input columns",hive and flink is ok
   
   note: dt is a not exist field in record.
   
   this is the story of how we got an error with spark,and thanks for your reply!


-- 
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@hudi.apache.org

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


[GitHub] [hudi] yihua commented on issue #6007: spark query partition field error

Posted by GitBox <gi...@apache.org>.
yihua commented on issue #6007:
URL: https://github.com/apache/hudi/issues/6007#issuecomment-1171775316

   @txl2017 Thanks for reporting this. @nsivabalan @alexeykudinkin if I'm not wrong, is this a known issue wrt the non-existent partition field? 


-- 
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@hudi.apache.org

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


[GitHub] [hudi] txl2017 commented on issue #6007: spark query partition field error

Posted by GitBox <gi...@apache.org>.
txl2017 commented on issue #6007:
URL: https://github.com/apache/hudi/issues/6007#issuecomment-1181209134

   use 0.11.1, is ok now


-- 
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@hudi.apache.org

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


[GitHub] [hudi] txl2017 closed issue #6007: spark query partition field error

Posted by GitBox <gi...@apache.org>.
txl2017 closed issue #6007: spark query partition field error
URL: https://github.com/apache/hudi/issues/6007


-- 
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@hudi.apache.org

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