Skip to content

Instantly share code, notes, and snippets.

@dvu4
Last active September 25, 2023 21:32
Show Gist options
  • Save dvu4/6d93add753bd125833e4eb6d0a3d8354 to your computer and use it in GitHub Desktop.
Save dvu4/6d93add753bd125833e4eb6d0a3d8354 to your computer and use it in GitHub Desktop.
This script will create Hive metastore table in Databricks Catalog

Create Hive metastore table

# Create database schema
spark.sql("CREATE DATABASE IF NOT EXISTS csgci")


# Create Hive Internal table
df.write.mode("overwrite").option("overwriteSchema", "true").saveAsTable("csgci.drug_ic")

# Check if the table is created

%sql
select * from drug_ic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment