[ 
https://issues.apache.org/jira/browse/HUDI-7423?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

xy updated HUDI-7423:
---------------------
    Description: 
Support table type name case-sensitive.

When many user create table would set table.type = MOR/Mor/Cow/COW according to 
Hudi document,like:

 

CREATE TABLE `hudi_test`.`hudi_test29` (
  `app_id` STRING COMMENT '应用id',
  `message_id` STRING COMMENT '消息id',
  `dt` INT,
  `from` STRING,
  `day` STRING COMMENT '日期分区',
  `hour` INT COMMENT '小时分区'
)using hudi
tblproperties (
  'primaryKey' = 'app_id,message_id',
  'type' = 'MOR',
  'preCombineField'='dt',
  'hoodie.index.type' = 'BUCKET',
  'hoodie.bucket.index.hash.field' = 'app_id,message_id',
  'hoodie.bucket.index.num.buckets'=256,
  'hoodie.datasource.hive_sync.table.strategy'='RT'
)
PARTITIONED BY (`day`,`hour`);

 

it would occur error as: 

java.lang.IllegalArgumentException: No enum constant 
org.apache.hudi.common.model.HoodieTableType.MOR
    at java.lang.Enum.valueOf(Enum.java:238)
    at 
org.apache.hudi.common.model.HoodieTableType.valueOf(HoodieTableType.java:30)
    at 
org.apache.hudi.common.table.HoodieTableMetaClient$PropertyBuilder.setTableType(HoodieTableMetaClient.java:833)
    at 
org.apache.hudi.common.table.HoodieTableMetaClient$PropertyBuilder.fromProperties(HoodieTableMetaClient.java:1009)
    at 
org.apache.spark.sql.catalyst.catalog.HoodieCatalogTable.initHoodieTable(HoodieCatalogTable.scala:219)
    at 
org.apache.spark.sql.hudi.command.CreateHoodieTableCommand.run(CreateHoodieTableCommand.scala:70)
    at 
org.apache.spark.sql.execution.command.ExecutedCommandExec.sideEffectResult$lzycompute(commands.scala:80)
    at 
org.apache.spark.sql.execution.command.ExecutedCommandExec.sideEffectResult(commands.scala:78)
    at 
org.apache.spark.sql.execution.command.ExecutedCommandExec.executeCollect(commands.scala:89)
    at 
org.apache.spark.sql.execution.QueryExecution$$anonfun$eagerlyExecuteCommands$1.$anonfun$applyOrElse$1(QueryExecution.scala:110)
    at 
org.apache.spark.sql.execution.SQLExecution$.$anonfun$withNewExecutionId$5(SQLExecution.scala:103)

It is not friendly to user which must set table=mor/cow for users. So it is 
better make the config incase-sensitive to users

  was:
Support table type name case-sensitive.

When many user create table would set table.type = MOR/Mor/Cow/COW according to 
Hudi document,it would occur error as: 

java.lang.IllegalArgumentException: No enum constant 
org.apache.hudi.common.model.HoodieTableType.MOR
    at java.lang.Enum.valueOf(Enum.java:238)
    at 
org.apache.hudi.common.model.HoodieTableType.valueOf(HoodieTableType.java:30)
    at 
org.apache.hudi.common.table.HoodieTableMetaClient$PropertyBuilder.setTableType(HoodieTableMetaClient.java:833)
    at 
org.apache.hudi.common.table.HoodieTableMetaClient$PropertyBuilder.fromProperties(HoodieTableMetaClient.java:1009)
    at 
org.apache.spark.sql.catalyst.catalog.HoodieCatalogTable.initHoodieTable(HoodieCatalogTable.scala:219)
    at 
org.apache.spark.sql.hudi.command.CreateHoodieTableCommand.run(CreateHoodieTableCommand.scala:70)
    at 
org.apache.spark.sql.execution.command.ExecutedCommandExec.sideEffectResult$lzycompute(commands.scala:80)
    at 
org.apache.spark.sql.execution.command.ExecutedCommandExec.sideEffectResult(commands.scala:78)
    at 
org.apache.spark.sql.execution.command.ExecutedCommandExec.executeCollect(commands.scala:89)
    at 
org.apache.spark.sql.execution.QueryExecution$$anonfun$eagerlyExecuteCommands$1.$anonfun$applyOrElse$1(QueryExecution.scala:110)
    at 
org.apache.spark.sql.execution.SQLExecution$.$anonfun$withNewExecutionId$5(SQLExecution.scala:103)

It is not friendly to user which must set table=mor/cow for users. So it is 
better make the config incase-sensitive to users


> Support table type name case-sensitive
> --------------------------------------
>
>                 Key: HUDI-7423
>                 URL: https://issues.apache.org/jira/browse/HUDI-7423
>             Project: Apache Hudi
>          Issue Type: Improvement
>          Components: spark-sql
>            Reporter: xy
>            Priority: Major
>
> Support table type name case-sensitive.
> When many user create table would set table.type = MOR/Mor/Cow/COW according 
> to Hudi document,like:
>  
> CREATE TABLE `hudi_test`.`hudi_test29` (
>   `app_id` STRING COMMENT '应用id',
>   `message_id` STRING COMMENT '消息id',
>   `dt` INT,
>   `from` STRING,
>   `day` STRING COMMENT '日期分区',
>   `hour` INT COMMENT '小时分区'
> )using hudi
> tblproperties (
>   'primaryKey' = 'app_id,message_id',
>   'type' = 'MOR',
>   'preCombineField'='dt',
>   'hoodie.index.type' = 'BUCKET',
>   'hoodie.bucket.index.hash.field' = 'app_id,message_id',
>   'hoodie.bucket.index.num.buckets'=256,
>   'hoodie.datasource.hive_sync.table.strategy'='RT'
> )
> PARTITIONED BY (`day`,`hour`);
>  
> it would occur error as: 
> java.lang.IllegalArgumentException: No enum constant 
> org.apache.hudi.common.model.HoodieTableType.MOR
>     at java.lang.Enum.valueOf(Enum.java:238)
>     at 
> org.apache.hudi.common.model.HoodieTableType.valueOf(HoodieTableType.java:30)
>     at 
> org.apache.hudi.common.table.HoodieTableMetaClient$PropertyBuilder.setTableType(HoodieTableMetaClient.java:833)
>     at 
> org.apache.hudi.common.table.HoodieTableMetaClient$PropertyBuilder.fromProperties(HoodieTableMetaClient.java:1009)
>     at 
> org.apache.spark.sql.catalyst.catalog.HoodieCatalogTable.initHoodieTable(HoodieCatalogTable.scala:219)
>     at 
> org.apache.spark.sql.hudi.command.CreateHoodieTableCommand.run(CreateHoodieTableCommand.scala:70)
>     at 
> org.apache.spark.sql.execution.command.ExecutedCommandExec.sideEffectResult$lzycompute(commands.scala:80)
>     at 
> org.apache.spark.sql.execution.command.ExecutedCommandExec.sideEffectResult(commands.scala:78)
>     at 
> org.apache.spark.sql.execution.command.ExecutedCommandExec.executeCollect(commands.scala:89)
>     at 
> org.apache.spark.sql.execution.QueryExecution$$anonfun$eagerlyExecuteCommands$1.$anonfun$applyOrElse$1(QueryExecution.scala:110)
>     at 
> org.apache.spark.sql.execution.SQLExecution$.$anonfun$withNewExecutionId$5(SQLExecution.scala:103)
> It is not friendly to user which must set table=mor/cow for users. So it is 
> better make the config incase-sensitive to users



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to