我試圖從CREATE AS
和HiveCLI上的動態分區的另一個表中創建一個新表。我是從蜂巢官方的wiki學習哪裏有這個例子:動態分區+在HIVE上創建AS
CREATE TABLE T (key int, value string)
PARTITIONED BY (ds string, hr int) AS
SELECT key, value, ds, hr+1 hr1
FROM srcpart
WHERE ds is not null
And hr>10;
但我收到此錯誤:
FAILED: SemanticException [Error 10065]:
CREATE TABLE AS SELECT command cannot specify the list of columns for the target table
來源:https://cwiki.apache.org/confluence/display/Hive/DynamicPartitions#DynamicPartitions-Syntax
是的,我做到了,它似乎是最好的和獨特的解決方案 –
如果你*不知道目標表的完整模式,最好的方法是什麼?是否有可能只使用配置單元查詢從未分區的表生成分區表? – Noah