@@ -560,6 +560,7 @@ def test_create(started_cluster):
560560 node .query (f"INSERT INTO { CATALOG_NAME } .`{ root_namespace } .{ table_name } ` VALUES ('AAPL');" , settings = {"allow_experimental_insert_into_iceberg" : 1 , 'write_full_path_in_iceberg_metadata' : 1 })
561561 assert node .query (f"SELECT * FROM { CATALOG_NAME } .`{ root_namespace } .{ table_name } `" ) == "AAPL\n "
562562
563+
563564def test_drop_table (started_cluster ):
564565 node = started_cluster .instances ["node1" ]
565566
@@ -575,3 +576,27 @@ def test_drop_table(started_cluster):
575576
576577 drop_clickhouse_iceberg_table (node , root_namespace , table_name )
577578 assert len (catalog .list_tables (root_namespace )) == 0
579+
580+
581+ def test_table_with_slash (started_cluster ):
582+ node = started_cluster .instances ["node1" ]
583+
584+ # pyiceberg at current moment (version 0.9.1) has a bug with table names with slashes
585+ # see https://github.com/apache/iceberg-python/issues/2462
586+ # so we need to encode it manually
587+ table_raw_suffix = "table/foo"
588+ table_encoded_suffix = "table%2Ffoo"
589+
590+ test_ref = f"test_list_tables_{ uuid .uuid4 ()} "
591+ table_name = f"{ test_ref } _{ table_raw_suffix } "
592+ table_encoded_name = f"{ test_ref } _{ table_encoded_suffix } "
593+ root_namespace = f"{ test_ref } _namespace"
594+
595+ catalog = load_catalog_impl (started_cluster )
596+ catalog .create_namespace (root_namespace )
597+
598+ create_table (catalog , root_namespace , table_name , DEFAULT_SCHEMA , PartitionSpec (), DEFAULT_SORT_ORDER )
599+
600+ create_clickhouse_iceberg_database (started_cluster , node , CATALOG_NAME )
601+ 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 })
602+ assert node .query (f"SELECT * FROM { CATALOG_NAME } .`{ root_namespace } .{ table_encoded_name } `" ) == "\\ N\t AAPL\t 193.24\t 193.31\t ('bot')\n "
0 commit comments