Description:
Retrieve ORC/Parquet data.
Syntax:
f.hdfs_import([col,…])
Note:
External library function (See External Library Guide for uses).
It retrieves ORC or Parquet data from local or HDFS files.
Parameter:
f |
A local or HDFS file object of ORC or Parquet format. |
col |
A to-be-retrieved column; return all fields by default. |
Option:
@c |
Enable returning a cursor. |
@p |
Enable retrieving Parquet data; retrieve ORC data by default. |
Return value:
Table sequence
Example:
|
|
|
|
=file("F:/tmp/mytest.orc") |
Open a local ORC format data file. |
|
=A1.hdfs_import() |
Retrieve the ORC file and return all its fields. |
|
=A1.hdfs_import@c() |
Return a cursor. |
|
|
Open an ORC format data file in HDFS. |
|
|
Retrieve certain fields. |
|
=hive_open("hdfs://localhost:9000","thrift://localhost:9083","hive","asus") |
Connect to Hive database. |
|
=hive_table@p(A6) |
Retrieve all Parquet format tables. |
|
=A7.select(tableName=="myParquet") |
Select myParquet table. |
|
=file(A8.location) |
Load the corresponding HDFS file. |
|
=A9.hdfs_import@p() |
Retrieve data from the table. |
|
|
|