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/20 22:05:49 UTC

[GitHub] [hudi] Reimus opened a new issue, #5915: [SUPPORT] Schema Evolution - Changing field type from Date to String is not supported

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

   In the documentation it says changing type from Date to String is supported (in the source/target table)
   
   Yet command using spark sql with sql extensions installed:
   
   ```
   ALTER TABLE `table` ALTER COLUMN ymd TYPE string;
   ```
   Produces output
   ```
   ALTER TABLE CHANGE COLUMN is not supported for changing column 'ymd' with type 'DateType' to 'ymd' with type 'StringType'
   ```
   
   **Expected behaviour**
   
   Either docs clearly state this is not supported - or it works as expected.
   
   **Environment Description**
   
   * Hudi version : 0.11
   
   * Spark version : 3.1.2
   
   * Hadoop version : 3.0.X
   
   * 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] minihippo commented on issue #5915: [SUPPORT] Schema Evolution - Changing field type from Date to String is not supported

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

   @Reimus Is `Date` a 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] minihippo commented on issue #5915: [SUPPORT] Schema Evolution - Changing field type from Date to String is not supported

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

   @Reimus Has your problem been solved? if it is, feel free to close 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] nsivabalan commented on issue #5915: [SUPPORT] Schema Evolution - Changing field type from Date to String is not supported

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

   please give the comprehensive schema evolution a try. please raise a new issue if you need more assistance. 


-- 
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 closed issue #5915: [SUPPORT] Schema Evolution - Changing field type from Date to String is not supported

Posted by GitBox <gi...@apache.org>.
nsivabalan closed issue #5915: [SUPPORT] Schema Evolution - Changing field type from Date to String is not supported
URL: https://github.com/apache/hudi/issues/5915


-- 
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] Reimus commented on issue #5915: [SUPPORT] Schema Evolution - Changing field type from Date to String is not supported

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

   @minihippo 
   No, just a regular field.
   It was included in the data skipping index though.
   
   Here is a creation / update spark.write commands I'm using to add/save data
   ```
    ds.write
         .format("hudi")
         .mode(SaveMode.Append)
         .option(DataSourceWriteOptions.PRECOMBINE_FIELD.key, "ts")
         .option(DataSourceWriteOptions.RECORDKEY_FIELD.key, "id")
         .option(DataSourceWriteOptions.PARTITIONPATH_FIELD.key, "ym")
         .option(DataSourceWriteOptions.OPERATION.key, DataSourceWriteOptions.UPSERT_OPERATION_OPT_VAL)
         .option(HoodieWriteConfig.TBL_NAME.key, tableName)
         .option(DataSourceWriteOptions.RECONCILE_SCHEMA.key, "true")
         .option(DataSourceWriteOptions.TABLE_TYPE.key, DataSourceWriteOptions.MOR_TABLE_TYPE_OPT_VAL)
         .option(DataSourceWriteOptions.OPERATION.key, DataSourceWriteOptions.UPSERT_OPERATION_OPT_VAL)
         .option(HoodieTableConfig.TIMELINE_TIMEZONE.key, HoodieTimelineTimeZone.UTC.name)
         .option(HoodieWriteConfig.SCHEMA_EVOLUTION_ENABLE.key, "true")
         .option(HoodieWriteConfig.AVRO_SCHEMA_VALIDATE_ENABLE.key, "true")
         .option(HoodieWriteConfig.WRITE_CONCURRENCY_MODE.key, WriteConcurrencyMode.OPTIMISTIC_CONCURRENCY_CONTROL.name())
         .option(HoodieIndexConfig.BLOOM_FILTER_TYPE.key, BloomFilterTypeCode.DYNAMIC_V0.name)
         .option(HoodieIndexConfig.BLOOM_FILTER_NUM_ENTRIES_VALUE.key, String.valueOf(100000))
         .option(HoodieIndexConfig.BLOOM_INDEX_USE_METADATA.key, "true")
         .option(HoodieIndexConfig.BLOOM_INDEX_FILTER_DYNAMIC_MAX_ENTRIES.key, String.valueOf(1000000))
         .option(HoodieLockConfig.HIVE_DATABASE_NAME.key, databaseName)
         .option(HoodieLockConfig.HIVE_TABLE_NAME.key, tableName)
         .option(HoodieLockConfig.HIVE_METASTORE_URI.key, env.spark.hiveMetastore)
         .option(HoodieLockConfig.LOCK_PROVIDER_CLASS_NAME.key, classOf[org.apache.hudi.hive.HiveMetastoreBasedLockProvider].getName)
         .option(HoodieStorageConfig.PARQUET_MAX_FILE_SIZE.key, String.valueOf(256 * 1024 * 1024))
         .option(HoodieStorageConfig.PARQUET_BLOCK_SIZE.key, String.valueOf(256 * 1024 * 1024))
         .option(HoodieCompactionConfig.AUTO_CLEAN.key, "true")
         .option(HoodieCompactionConfig.FAILED_WRITES_CLEANER_POLICY.key, HoodieFailedWritesCleaningPolicy.LAZY.name)
   
         .option(HoodieCompactionConfig.CLEANER_POLICY.key, HoodieCleaningPolicy.KEEP_LATEST_BY_HOURS.name())
         .option(HoodieCompactionConfig.CLEANER_HOURS_RETAINED.key, String.valueOf(24))
         .option(HoodieCompactionConfig.PARQUET_SMALL_FILE_LIMIT.key, String.valueOf(104857600))
   
         .option(HoodieMetadataConfig.COLUMN_STATS_INDEX_FOR_COLUMNS.key, "ym,ymd,date,ts,lvl1.ymd,lvl1.lvl2.date")
         .option(HoodieMetadataConfig.BLOOM_FILTER_INDEX_FOR_COLUMNS.key, "id,col1,col2")
         .option(HoodieMetadataConfig.POPULATE_META_FIELDS.key, "true")
         .option(HoodieMetadataConfig.ENABLE_METADATA_INDEX_COLUMN_STATS.key, "true")
         .option(HoodieMetadataConfig.ENABLE_METADATA_INDEX_BLOOM_FILTER.key, "true")
         .option(HoodieMetadataConfig.ENABLE.key, "true")
         .save("/tmp/hudi")
   ```
   
   Partition field is `ym` field (string) - ymd is a regular date 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] xiarixiaoyao commented on issue #5915: [SUPPORT] Schema Evolution - Changing field type from Date to String is not supported

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

   @Reimus  only full schema evolution support change date type to string.
   
   when you use this feature, you should  execute set hoodie.schema.on.read.enable=true, before execute alter command. 
   https://hudi.apache.org/docs/schema_evolution


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