forked from marshackVB/databricks_feature_store
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscratch.py
42 lines (31 loc) · 1.61 KB
/
scratch.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# import sys
# import os
from pyspark.sql import SparkSession
spark = SparkSession.builder.appName("appName").getOrCreate()
# import pandas as pd
# import pyspark.sql.functions as F
# from pyspark.sql import DataFrame
# from functools import reduce
# from operator import add
# from datetime import datetime, timedelta
# from databricks.feature_store import FeatureStoreClient, feature_table
# fs = FeatureStoreClient()
# feat_table = fs.get_table(name="robkisk.demographic_features")
# fs.get_feature_table(name="robkisk.demographic_features")
# fs.read_table(name="robkisk.demographic_features")
# for t in spark.catalog.listTables("hive_metastore.robkisk"):
# print(t.name)
# for t in spark.catalog.listTables("robkisk.default"):
# print(t.name)
spark.table("hive_metastore.robkisk.passenger_demographic_base").show(3, False)
spark.table("hive_metastore.robkisk.passenger_ticket_base").show(3, False)
spark.table("hive_metastore.robkisk.passenger_ticket_features").show(3, False)
spark.table("hive_metastore.robkisk.passenger_demographic_features").show(3, False)
spark.table("hive_metastore.robkisk.passenger_labels").show(3, False)
# spark.sql("drop table hive_metastore.robkisk.demographic_features")
# spark.sql("drop table hive_metastore.robkisk.passenger_demographic_features")
# spark.sql("drop table hive_metastore.robkisk.passenger_labels")
# spark.sql("drop table hive_metastore.robkisk.passenger_ticket_features")
# spark.sql("drop table robkisk.default.sklearn_housing")
# spark.sql("drop table hive_metastore.robkisk.passenger_labels")
# spark.sql("drop table hive_metastore.robkisk.passenger_ticket_feautures")