创建名称中包含字符的配置单元表 [英] Creating hive table with characters in the name
问题描述
我试图用以下名称 $ example $ table在配置单元中创建一个表。
不允许我创建并给出以下错误:
I am trying to create a table in hive with the following name "$example$table". It is not allowing me to create and is giving the following error:
FAILED:执行错误,返回代码1来自org.apache.hadoop.hive.ql.exec.DDLTask。 org.apache.hadoop.hive.ql.metadata.HiveException:[$ ndo $ dbproperty]:不是有效的表名
有人可以在这里帮助我吗?要求是使用表名中的字符$,%,','创建表名。
Could anyone please help me out here? The requirement is to create tables name with characters like $,%,',' in the table name.
推荐答案
当前,特殊
https:/ /issues.apache.org/jira/browse/HIVE-6013
https://issues.apache.org/jira/browse/HIVE-11699
Ps 1
如果您足够勇敢,可以在元存储中重命名表。
P.s. 1
If you are brave enough you can rename the table within the metastore.
select * from metastore.TBLS where TBL_NAME = '$example$table';
+--------+-------------+-------+------------------+----------+-----------+-------+----------------+---------------+--------------------+--------------------+
| TBL_ID | CREATE_TIME | DB_ID | LAST_ACCESS_TIME | OWNER | RETENTION | SD_ID | TBL_NAME | TBL_TYPE | VIEW_EXPANDED_TEXT | VIEW_ORIGINAL_TEXT |
+--------+-------------+-------+------------------+----------+-----------+-------+----------------+---------------+--------------------+--------------------+
| 176 | 1494511100 | 2 | 0 | cloudera | 0 | 181 | $example$table | MANAGED_TABLE | (null) | (null) |
+--------+-------------+-------+------------------+----------+-----------+-------+----------------+---------------+--------------------+--------------------+
hive> select * from `$example$table`;
OK
1
2
3
Time taken: 0.58 seconds, Fetched: 3 row(s)
hive>
P.s。 2
您可能要看是(总理)大臣,以更好地理解勇敢
这篇关于创建名称中包含字符的配置单元表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!