feat: add basic ingest from spark iceberg example
This commit is contained in:
20
spark/create_table.py
Normal file
20
spark/create_table.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from pyspark.sql import SparkSession
|
||||
|
||||
spark = SparkSession.builder.appName("").getOrCreate()
|
||||
|
||||
print("creating database")
|
||||
spark.sql('CREATE DATABASE IF NOT EXISTS orders')
|
||||
|
||||
print("creating table")
|
||||
spark.sql('''
|
||||
CREATE TABLE IF NOT EXISTS orders.payments (
|
||||
id STRING,
|
||||
type STRING,
|
||||
created_at TIMESTAMP,
|
||||
document STRING,
|
||||
payer STRING,
|
||||
amount INT
|
||||
)
|
||||
USING iceberg
|
||||
PARTITIONED BY (document)
|
||||
''')
|
Reference in New Issue
Block a user