You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Zoltan Haindrich (Jira)" <ji...@apache.org> on 2020/01/24 16:22:00 UTC

[jira] [Commented] (HIVE-22723) SHOW CREATE TABLE omits backtics, results in syntax error

    [ https://issues.apache.org/jira/browse/HIVE-22723?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17023070#comment-17023070 ] 

Zoltan Haindrich commented on HIVE-22723:
-----------------------------------------

I think we may also want to consider to accept identifiers starting with _

mysql, psql accepts: 
{code}
create table _t(_a integer)
{code}
meanwhile hive and oracle does not.



> SHOW CREATE TABLE omits backtics, results in syntax error
> ---------------------------------------------------------
>
>                 Key: HIVE-22723
>                 URL: https://issues.apache.org/jira/browse/HIVE-22723
>             Project: Hive
>          Issue Type: Bug
>          Components: Hive
>         Environment: Run SHOW CREATE TABLE via AWS Athena
>            Reporter: Alex Yankelevich
>            Assignee: Miklos Gergely
>            Priority: Minor
>         Attachments: HIVE-22723.01.patch
>
>
> {code}
> CREATE EXTERNAL TABLE `alerts1`(
>  `_id` string COMMENT 'from deserializer', `org` string COMMENT 'from deserializer', `collector` string COMMENT 'from deserializer', `source` string COMMENT 'from deserializer', `entitytype` string COMMENT 'from deserializer', `entity` string COMMENT 'from deserializer', `rule` string COMMENT 'from deserializer', `findingdescid` string COMMENT 'from deserializer',
>  `details` struct<parameters:struct<host_version:string,build:struct<__numberint:string>>,findingtype:string,producttype:string,entityname:string,extra:struct<version:string,build:string,updaterev:string>,entityparams:struct<deployment:array<string>,version:string,build:string>> COMMENT 'from deserializer', `seenat` array<struct<__numberlong:string>> COMMENT 'from deserializer', `execution` array<struct<__numberlong:string>> COMMENT 'from deserializer', `lastmodified` struct<__numberint:string> COMMENT 'from deserializer'
> ) ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe' WITH SERDEPROPERTIES ( 'paths'='_id,collector,details,entity,entityType,execution,findingDescId,lastModified,org,rule,seenAt,source') STORED AS INPUTFORMAT 'org.apache.hadoop.mapred.TextInputFormat' OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' LOCATION 's3://redshift-poc-ay/alerts' TBLPROPERTIES ( 'CrawlerSchemaDeserializerVersion'='1.0', 'CrawlerSchemaSerializerVersion'='1.0', 'UPDATED_BY_CRAWLER'='redshift-poc-alerts-ay', 'averageRecordSize'='9619', 'classification'='json', 'compressionType'='none', 'objectCount'='1', 'recordCount'='21028', 'sizeKey'='202270843', 'transient_lastDdlTime'='1578946186', 'typeOfData'='file')
> {code}
>     __numberint, __numberlong columns are not generated enclosed in backticks even though they were explicitly created with them.  Therefore, the generated DDL is syntactically incorrect. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)