|
| 1 | +import pyarrow as pa |
| 2 | + |
| 3 | +from pyiceberg.catalog.glue import GlueCatalog |
| 4 | + |
| 5 | +# pd.set_option('display.max_rows', None) |
| 6 | + |
| 7 | + |
| 8 | +def test(): |
| 9 | + catalog = GlueCatalog("drew") |
| 10 | + table_name = "demo1.vec" |
| 11 | + # |
| 12 | + # catalog = load_catalog( |
| 13 | + # "catalog_name", |
| 14 | + # **{ |
| 15 | + # "type": "rest", |
| 16 | + # "warehouse":"arn:aws:s3tables:us-east-1:580974493829:bucket/drew", |
| 17 | + # "uri": "https://s3tables.us-east-1.amazonaws.com/iceberg", |
| 18 | + # "rest.sigv4-enabled": "true", |
| 19 | + # "rest.signing-name": "s3tables", |
| 20 | + # "rest.signing-region": "us-east-1" |
| 21 | + # } |
| 22 | + # ) |
| 23 | + |
| 24 | + df = pa.Table.from_pylist( |
| 25 | + [ |
| 26 | + {"city": "Amsterdam", "lat": 52.371807, "long": 4.896029}, |
| 27 | + {"city": "San Francisco", "lat": 37.773972, "long": -122.431297}, |
| 28 | + {"city": "Drachten", "lat": 53.11254, "long": 6.0989}, |
| 29 | + {"city": "Drachten", "lat": 53.11254, "long": 6.0989}, |
| 30 | + {"city": "Paris", "lat": 48.864716, "long": 2.349014}, |
| 31 | + ], |
| 32 | + ) |
| 33 | + |
| 34 | + # tbl = catalog.create_table("demo1.cities2", schema=df.schema, location="s3://dru-iad/demo1/cities2") |
| 35 | + table = catalog.load_table(("yeehaw", "lmfao")) |
| 36 | + print(table) |
0 commit comments