Created
October 1, 2020 04:11
-
-
Save welly87/29472b1f5fc2200f8ceee3678e361e9a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
? |
Author
welly87
commented
Oct 1, 2020
tdf = trans.select("*").toPandas()
tdf.head()
SELECT * FROM welly.transactions_1k;
CREATE EXTERNAL TABLE 001_andi.transactions_1k
STORED AS KUDU
TBLPROPERTIES (
'kudu.table_name' = 'transactions_1k'
);
CREATE EXTERNAL TABLE welly.transactions_1k
STORED AS KUDU
TBLPROPERTIES (
'kudu.table_name' = 'transactions_1k'
);
CREATE EXTERNAL TABLE welly.customers
STORED AS KUDU
TBLPROPERTIES (
'kudu.table_name' = 'customers'
);
CREATE EXTERNAL TABLE welly.gasstations
STORED AS KUDU
TBLPROPERTIES (
'kudu.table_name' = 'gasstations'
);
CREATE EXTERNAL TABLE welly.products
STORED AS KUDU
TBLPROPERTIES (
'kudu.table_name' = 'products'
);
!pip install impyla
from impala.dbapi import connect
from impala.util import as_pandas
conn = connect(host='178.128.112.105', port=21050)
cursor = conn.cursor()
cursor.execute('SELECT * FROM welly.transactions_1k LIMIT 100')
df = as_pandas(cursor)
df.head()
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment