...
Note | ||||||
---|---|---|---|---|---|---|
| ||||||
The fully qualified package name changed from org.apache.hcatalog.pig to org.apache.hive.hcatalog.pig in Pig versions 0.14+. In many older web site examples you may find references to the old syntax which no longer functions.
|
...
No Format |
---|
A = LOAD 'tablename' USING org.apache.hive.hcatalog.pig.HCatLoader();
|
Assumptions
You must specify the table name in single quotes: LOAD 'tablename'. If you are using a non-default database you must specify your input as 'dbname.tablename'. If you are using Pig 0.9.2 or earlier, you must create your database and table prior to running the Pig script. Beginning with Pig 0.10 you can issue these create commands in Pig using the SQL command. Details of Pig syntax can be found in PIG-2482.
...
- map – key type should be string
- List<ARRAY<any type>
- struct<any type fields>
...
Info | ||
---|---|---|
| ||
Hive does not have a data type corresponding to the big integer type in Pig. |
...
...
Running Pig with HCatalog
Pig does not automatically pick up HCatalog jars. To bring in the necessary jars, you can either use a flag in the pig command or set the environment variables PIG_CLASSPATH and PIG_OPTS as described below.
...
Hive Type | Pig Type |
---|---|
map (key type should be string) | map |
List<ARRAY<any type> | bag |
struct<any type fields> | tuple |
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
Previous: HCatalog Configuration Properties General: HCatalog Manual – WebHCat Manual – Hive Wiki Home – Hive Project Site |