Skip to content

Instantly share code, notes, and snippets.

@sairamkrish
Created December 30, 2021 00:02
Show Gist options
  • Save sairamkrish/4a06242b224f30aa461ca7aeebb4188c to your computer and use it in GitHub Desktop.
Save sairamkrish/4a06242b224f30aa461ca7aeebb4188c to your computer and use it in GitHub Desktop.
-- 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