Как создать таблицу улья с '@' в столбце типа структуры? - PullRequest
0 голосов
/ 06 декабря 2018

hive creata sql:
CREATE EXTERNAL TABLE склад . aaa ( свойства struct< sk @ aaa :string > ) PARTITIONED BY ( dt string) ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe' WITH SERDEPROPERTIES ( 'serialization.format' = '1' ) STORED AS INPUTFORMAT 'org.apache.hadoop.mapred.TextInputFormat' OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' LOCATION 'hdfs://.....';

сообщение об ошибке:

FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. java.lang.IllegalArgumentException: Error: : expected at the position 9 of 'struct<sk@aaa:string>' but '@' is found

как создать таблицу кустов с @ в столбце структуры?

1 Ответ

0 голосов
/ 06 декабря 2018

Вы можете использовать обратные метки в случае специальных символов для HBase 0.13 и более поздних версий.

struct<`sk@aaa`:string>

Для получения более подробной информации см. Документацию: https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Select

In Hive 0.12 and earlier, only alphanumeric and underscore characters are allowed in table and column names.
In Hive 0.13 and later, column names can contain any Unicode character (see HIVE-6013). Any column name that is specified within backticks (`) is treated literally. Within a backtick string, use double backticks (``) to represent a backtick character.
To revert to pre-0.13.0 behavior and restrict column names to alphanumeric and underscore characters, set the configuration property hive.support.quoted.identifiers to none. In this configuration, backticked names are interpreted as regular expressions. For details, see Supporting Quoted Identifiers in Column Names (attached to HIVE-6013). Also see REGEX Column Specification below.
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...