Skip to content

Commit f3f830d

Browse files
committed
Fix test, write with pyiceberg
1 parent a514c18 commit f3f830d

File tree

1 file changed

+13
-2
lines changed
  • tests/integration/test_database_iceberg

1 file changed

+13
-2
lines changed

tests/integration/test_database_iceberg/test.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,18 @@ def test_table_with_slash(started_cluster):
404404
catalog.create_namespace(root_namespace)
405405

406406
create_table(catalog, root_namespace, table_name, DEFAULT_SCHEMA, PartitionSpec(), DEFAULT_SORT_ORDER)
407+
table = catalog.load_table(f"{root_namespace}.{table_encoded_name}")
408+
data = [
409+
{
410+
"datetime": datetime.strptime("2025-01-01 12:00:00", "%Y-%m-%d %H:%M:%S"),
411+
"symbol": "AAPL",
412+
"bid": 193.24,
413+
"ask": 193.31,
414+
"details": {"created_by": "bot"},
415+
}
416+
]
417+
df = pa.Table.from_pylist(data)
418+
table.append(df)
407419

408420
create_clickhouse_iceberg_database(started_cluster, node, CATALOG_NAME)
409-
node.query(f"INSERT INTO {CATALOG_NAME}.`{root_namespace}.{table_encoded_name}` VALUES (NULL, 'AAPL', 193.24, 193.31, tuple('bot'));", settings={"allow_experimental_insert_into_iceberg": 1, 'write_full_path_in_iceberg_metadata': 1})
410-
assert node.query(f"SELECT * FROM {CATALOG_NAME}.`{root_namespace}.{table_encoded_name}`") == "\\N\tAAPL\t193.24\t193.31\t('bot')\n"
421+
assert node.query(f"SELECT * FROM {CATALOG_NAME}.`{root_namespace}.{table_encoded_name}`") == "2025-01-01 12:00:00.000000\tAAPL\t193.24\t193.31\t('bot')\n"

0 commit comments

Comments
 (0)