First I created an external bush table, broken down by code and date
CREATE EXTERNAL TABLE IF NOT EXISTS XYZ ( ID STRING, SAL BIGINT, NAME STRING, ) PARTITIONED BY (CODE INT,DATE STRING) ROW FORMAT SERDE 'parquet.hive.serde.ParquetHiveSerDe' STORED AS INPUTFORMAT "parquet.hive.DeprecatedParquetInputFormat" OUTPUTFORMAT "parquet.hive.DeprecatedParquetOutputFormat" LOCATION '/old_work/XYZ';
and then I do an overwrite insert in this table, taking data from another table
INSERT OVERWRITE TABLE XYZ PARTITION (CODE,DATE) SELECT * FROM TEMP_XYZ;
and after that I count the number of entries in the hive, select count (*) from XYZ; this shows that I have 1000 entries and then I rename or move the location / old _work / XYZ 'to' / new_work / XYZ '
and then I will remove the XYZ table again and again create an address location in a new directory means '/ new_work / XYZ'
CREATE EXTERNAL TABLE IF NOT EXISTS XYZ ( ID STRING, SAL BIGINT, NAME STRING, ) PARTITIONED BY (CODE INT,DATE STRING) ROW FORMAT SERDE 'parquet.hive.serde.ParquetHiveSerDe' STORED AS INPUTFORMAT "parquet.hive.DeprecatedParquetInputFormat" OUTPUTFORMAT "parquet.hive.DeprecatedParquetOutputFormat" LOCATION '/new_work/XYZ';
But then when I execute select count (*) from the XYZ table in the hive, it shows 0 records, I think I missed something, please help me on this ????
bunty source share