Created
December 30, 2021 00:02
-
-
Save sairamkrish/4a06242b224f30aa461ca7aeebb4188c 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
-- Need to manually run each query now. | |
CREATE SCHEMA IF NOT EXISTS hive.iris | |
WITH (location = 's3a://iris/'); | |
-- Path s3a://iris/iris_data is the holding directory. We dont give full file path. Only parent directory | |
CREATE TABLE IF NOT EXISTS hive.iris.iris_data ( | |
sepal_length DOUBLE, | |
sepal_width DOUBLE, | |
petal_length DOUBLE, | |
petal_width DOUBLE, | |
class VARCHAR | |
) | |
WITH ( | |
external_location = 's3a://iris/iris_data', | |
format = 'PARQUET' | |
); | |
-- Testing | |
SELECT | |
sepal_length, | |
class | |
FROM hive.iris.iris_data | |
LIMIT 10; | |
SHOW TABLES IN hive.iris; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment