1

日付で分割されたテーブルを作成します。ただし、where 句でパーティションを使用することはできません。プロセス step1 は次のとおりです。

     CREATE TABLE new_table (
           a string,
           b string
      )
     PARTITIONED BY (dt string);

ステップ2:

        Insert overwrite table new_table partition (dt=$date)
        Select a, b from my_table
        where dt = '$date

テーブルが作成されます。

           Describe new_table;
           a string
           b string
           dt string

問題:

           select * from new_table where dt='$date'

空のセットを返します。

一方

            select * from new_table 

a、b、および dt を返します。

これの理由が何であるか知っている人はいますか?

ありがとう

4

2 に答える 2

0

で挿入してみてください

Insert overwrite table new_table partition (dt=$date)
    Select a, b, dt from my_table
    where dt = '$date'
于 2013-01-13T10:32:50.380 に答える
0

サハラ、where句のパーティションは機能します。述語の RHS で間違った値を指定している可能性はありますか?

内部のデータ/user/hive/warehouse/new_table(デフォルト) を表示して、そこにあるデータが期待どおりに見えるかどうかを確認することもできます。

于 2012-12-17T23:09:14.527 に答える