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/12/01 05:30:04 UTC

[GitHub] [hudi] JoshuaZhuCN opened a new issue, #7351: [SUPPORT] The keygenerator.class value set when using SparkSQL to create a table does not finally take effect in hoodie.properties

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

   The keygenerator.class value set when using SparkSQL to create a table does not finally take effect in hoodie.properties
   
   e.g: we want to set the value to 'ComplexKeyGenerator' but finally it is 'SimpleKeyGenerator' in hoodie.properties
   
   **To Reproduce**
   
   Steps to reproduce the behavior:
   
   1. execute th create table ddl like :
   ```
   spark.sql("drop table if exists `default`.`spark_0_12_1_test`")
   spark.sql(
       s"""|
           |CREATE TABLE IF NOT EXISTS `default`.`spark_0_12_1_test` (
           |     `id` INT
           |    ,`name` STRING
           |    ,`age` INT
           |    ,`sync_time` TIMESTAMP
           |) USING HUDI
           |TBLPROPERTIES (
           |     `type` = 'mor'
           |    ,`primaryKey` = 'id'
           |    ,`preCombineField` = 'sync_time'
           |    ,`hoodie.index.bucket.engine` = 'CONSISTENT_HASHING'
           |    ,`hoodie.bucket.index.hash.field` = 'id'
           |    ,`hoodie.index.type` = 'BUCKET'
           |    ,`hoodie.datasource.write.hive_style_partitioning` = 'false'
           |    ,`hoodie.storage.layout.type` = 'BUCKET'
           |    ,`hoodie.storage.layout.partitioner.class` = 'org.apache.hudi.table.action.commit.SparkBucketIndexPartitioner'
           |    ,`hoodie.datasource.write.keygenerator.class` = 'org.apache.hudi.keygen.ComplexKeyGenerator'
           |    ,`hoodie.compaction.payload.class` = 'org.apache.hudi.common.model.OverwriteWithLatestAvroPayload'
           |)
           |COMMENT 'test_0.12.1' 
           |PARTITIONED BY (id) 
           |""".stripMargin
   )
   ```
   2. View the hoodie.properties file and find that its value is not the value specified in the DDL
   ![image](https://user-images.githubusercontent.com/62231347/204973200-fc8ecc9b-c2bc-41aa-ba60-152f85234d6e.png)
   
   
   
   **Environment Description**
   
   * Hudi version : 0.12.1
   
   * Spark version : 3.1.3
   
   * Hive version : 3.1.1
   
   * Hadoop version : 3.1.0
   
   * Storage (HDFS/S3/GCS..) : HDFS
   
   * Running on Docker? (yes/no) : no
   
   
   


-- 
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] xushiyan commented on issue #7351: [SUPPORT] The keygenerator.class value set when using SparkSQL to create a table does not finally take effect in hoodie.properties

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

   @jonvex can you look into this pls?


-- 
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] jonvex commented on issue #7351: [SUPPORT] The keygenerator.class value set when using SparkSQL to create a table does not finally take effect in hoodie.properties

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

   https://issues.apache.org/jira/browse/HUDI-5262 I reported this a few weeks ago. You need to use `hoodie.table.keygenerator.class` to set the keygenerator when creating a table in spark-sql


-- 
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] nsivabalan commented on issue #7351: [SUPPORT] The keygenerator.class value set when using SparkSQL to create a table does not finally take effect in hoodie.properties

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

   @jonvex : can you fix our quick start guide around this please. do create a jira as well. 


-- 
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] jonvex commented on issue #7351: [SUPPORT] The keygenerator.class value set when using SparkSQL to create a table does not finally take effect in hoodie.properties

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

   @xushiyan https://github.com/apache/hudi/pull/7394 here is an example pr. Instead of failing, another option is to set the correct config


-- 
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] jonvex commented on issue #7351: [SUPPORT] The keygenerator.class value set when using SparkSQL to create a table does not finally take effect in hoodie.properties

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

   PR's are ready for review and then we can close this out


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


Re: [I] [SUPPORT] The keygenerator.class value set when using SparkSQL to create a table does not finally take effect in hoodie.properties [hudi]

Posted by "ad1happy2go (via GitHub)" <gi...@apache.org>.
ad1happy2go closed issue #7351: [SUPPORT] The keygenerator.class value set when using SparkSQL to create a table does not finally take effect in hoodie.properties
URL: https://github.com/apache/hudi/issues/7351


-- 
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] JoshuaZhuCN commented on issue #7351: [SUPPORT] The keygenerator.class value set when using SparkSQL to create a table does not finally take effect in hoodie.properties

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

   > Yeah, the `HoodieCatalogTable#initHoodieTable` does not copy the option `hoodie.table.keygenerator.class` like what the sql writer does: `HoodieSparkSqlWriter#mergeParamsAndGetHoodieConfig`, but I guess it is for design purpose, the write config can override the table config for writer path to init table, but not the case for catalog table creation/modification.
   > 
   > @nsivabalan Can you help double check this ?
   
   If we set a value different from that in hoodie.properties when writing data, an error will be reported
   ![image](https://user-images.githubusercontent.com/62231347/205027541-2b9933d1-7a55-4f40-b541-adfa5f2c8605.png)
   


-- 
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] danny0405 commented on issue #7351: [SUPPORT] The keygenerator.class value set when using SparkSQL to create a table does not finally take effect in hoodie.properties

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

   Yeah, the `HoodieCatalogTable#initHoodieTable` does not copy the option `hoodie.table.keygenerator.class` like what the sql writer does: `HoodieSparkSqlWriter#mergeParamsAndGetHoodieConfig`, but I guess it is for design purpose, the write config can override the table config for writer path to init table, but not the case for catalog table creation/modification.
   
   @nsivabalan Can you help double check this ?


-- 
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] JoshuaZhuCN commented on issue #7351: [SUPPORT] The keygenerator.class value set when using SparkSQL to create a table does not finally take effect in hoodie.properties

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

   > > Yeah, the `HoodieCatalogTable#initHoodieTable` does not copy the option `hoodie.table.keygenerator.class` like what the sql writer does: `HoodieSparkSqlWriter#mergeParamsAndGetHoodieConfig`, but I guess it is for design purpose, the write config can override the table config for writer path to init table, but not the case for catalog table creation/modification.
   > > @nsivabalan Can you help double check this ?
   > 
   > If we set a value different from that in hoodie.properties when writing data, an error will be reported ![image](https://user-images.githubusercontent.com/62231347/205027541-2b9933d1-7a55-4f40-b541-adfa5f2c8605.png)
   
   i get it, it need not to set this option any more in datasource write mode if ddl has set


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