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

   @YannByron Hello
   
    https://issues.apache.org/jira/browse/HUDI-4487  this fix to create rt/ro 
manually,but it forbid to use options(`hoodie.query.as.ro.table` = 'false') in 
spark sql to create table,
   
   **Now how can i create a hudi table without suffix in snapshot read mode 
using SparkSQL.**
   we just want to use hudi tale like a rdbms table, query a table can read all 
the data, not using suffix table name( which will make users increase learning 
costs and confuse SQL usage)
   
   ```
   CREATE TABLE IF NOT EXISTS `default`.`hudi_test_snapshot_mode` (
        `id` INT
       ,`name` STRING
       ,`age` INT
       ,`sync_time` TIMESTAMP
   ) USING HUDI
   OPTIONS(
     `hoodie.query.as.ro.table` = 'false
   )
   TBLPROPERTIES (
        type = 'mor'
       ,primaryKey = 'id'
       ,preCombineField = 'sync_time'
       ,`hoodie.compaction.payload.class` = 
'org.apache.hudi.common.model.OverwriteWithLatestAvroPayload'
       ,`hoodie.datasource.write.hive_style_partitioning` = 'false'
       ,`hoodie.table.keygenerator.class` = 
'org.apache.hudi.keygen.NonpartitionedKeyGenerator'
       ,`hoodie.index.type` = 'GLOBAL_BLOOM'
   )
   ```
   
   * Hudi version : 0.12.1
   
   * Spark version : 3.1.3
   
   * Hive version : 3.1.0
   
   * Hadoop version : 3.1.1
   
   * Storage (HDFS/S3/GCS..) : HDFS
   
   * Running on Docker? (yes/no) : no
   
   
   **Additional context**
   
   Add any other context about the problem here.
   
   **Stacktrace**
   
   ```Exception in thread "main" org.apache.spark.sql.AnalysisException: 
Creating ro/rt table need the existence of the base table.
        at 
org.apache.spark.sql.hudi.command.CreateHoodieTableCommand.run(CreateHoodieTableCommand.scala:74)
        at 
org.apache.spark.sql.execution.command.ExecutedCommandExec.sideEffectResult$lzycompute(commands.scala:70)
        at 
org.apache.spark.sql.execution.command.ExecutedCommandExec.sideEffectResult(commands.scala:68)
        at 
org.apache.spark.sql.execution.command.ExecutedCommandExec.executeCollect(commands.scala:79)
        at 
org.apache.spark.sql.Dataset.$anonfun$logicalPlan$1(Dataset.scala:228)
        at 
org.apache.spark.sql.Dataset.$anonfun$withAction$1(Dataset.scala:3700)
        at 
org.apache.spark.sql.execution.SQLExecution$.$anonfun$withNewExecutionId$5(SQLExecution.scala:103)
        at 
org.apache.spark.sql.execution.SQLExecution$.withSQLConfPropagated(SQLExecution.scala:163)
        at 
org.apache.spark.sql.execution.SQLExecution$.$anonfun$withNewExecutionId$1(SQLExecution.scala:90)
        at org.apache.spark.sql.SparkSession.withActive(SparkSession.scala:775)
        at 
org.apache.spark.sql.execution.SQLExecution$.withNewExecutionId(SQLExecution.scala:64)
        at org.apache.spark.sql.Dataset.withAction(Dataset.scala:3698)
        at org.apache.spark.sql.Dataset.<init>(Dataset.scala:228)
        at org.apache.spark.sql.Dataset$.$anonfun$ofRows$2(Dataset.scala:99)
        at org.apache.spark.sql.SparkSession.withActive(SparkSession.scala:775)
        at org.apache.spark.sql.Dataset$.ofRows(Dataset.scala:96)
        at 
org.apache.spark.sql.SparkSession.$anonfun$sql$1(SparkSession.scala:618)
        at org.apache.spark.sql.SparkSession.withActive(SparkSession.scala:775)
        at org.apache.spark.sql.SparkSession.sql(SparkSession.scala:613)```
   
   


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