firecast commented on issue #879: Hive Sync Error when creating a table with 
partition
URL: https://github.com/apache/incubator-hudi/issues/879#issuecomment-530308821
 
 
   It looks like the issue is with the partition name `__xxx_date`. When I 
tried the SQL hoodie was doing it gave the following error in Hive
   `FAILED: ParseException line 1:503 cannot recognize input near '__xx_date__' 
'string' ')' in column specification`
   
   So I escaped the partition column manually in the SQL and it worked.
   ```
   CREATE EXTERNAL TABLE  IF NOT EXISTS default.hudi_test( 
`_hoodie_commit_time` string, `_hoodie_commit_seqno` string, 
`_hoodie_record_key` string, `_hoodie_partition_path` string, 
`_hoodie_file_name` string, `gender` string, `comments` string, `title` string, 
`cc` string, `ip_address` string, `last_name` string, `id` bigint, 
`birth__xx_date__` string, `salary` string, `registration_dttm` string, 
`country` string, `email` string, `first_name` string, `key` string, 
`timestamp` bigint) PARTITIONED BY (`__xx_date__` string) ROW FORMAT SERDE 
'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe' STORED AS 
INPUTFORMAT 'org.apache.hudi.hadoop.HoodieInputFormat' OUTPUTFORMAT 
'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat' LOCATION 
's3a://demo-bucket/catalogs/hudi_test/hudi'
   ```
   
   It looks like HUDI does not escape the column name in the partition clause.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to