Because a lot of data is on the Hadoop platform, when migrating data from the hadoop platform to the hive directory, the default delimiter of hive is \, In order to smooth migration, you must specify the data delimiter when creating a table. The syntax is as follows:
Create table test (uid string, name string) row format delimited fields terminated by '\ T ';
In this way, the separator is specified.
Then, use hadoop fs-cp or hadoop distcp to copy folders.
Because the cost of data replication is relatively high and the time is relatively slow, when you do not need to copy data, you can directly move hadoop data to hive, hadoop fs-mv src dest.
A simple method is to directly create an external table. The syntax is as follows:
Create table test (uid string, name string) row format delimited fields terminated by '\ t' location 'hdfs ';
This method avoids time loss caused by data movement and improves the running efficiency.