jayceslesar commented on issue #2166:
URL: 
https://github.com/apache/iceberg-python/issues/2166#issuecomment-3025734976

   I am unable to reproduce with the following on `v0.9.0rc3` or on `main` -- 
can you provide some more details if possible?
   
   Let me know if there are any modifications I should make to the following:
   
   ```py
   from pyparsing import results
   from pyiceberg import catalog
   from pyiceberg.schema import Schema, NestedField, StringType
   import pyathena
   import pyarrow as pa
   
   glue_catalog = catalog.load_catalog(**{"type": "glue"})
   
   if glue_catalog.table_exists("make_me_corrupt.corrupt_me"):
       glue_catalog.drop_table("make_me_corrupt.corrupt_me")
   
   glue_catalog.create_namespace_if_not_exists("make_me_corrupt")
   
   schema = Schema(
       NestedField(field_id=1, name="field1", field_type=StringType(), 
required=True),
   )
   
   table = glue_catalog.create_table(
       "make_me_corrupt.corrupt_me",
       schema=schema,
       location="s3://my-bucket/jayce",
   )
   
   cursor = pyathena.connect(
       s3_staging_dir="s3://my-bucket/jayce/athena_results/",
       region_name="us-east-1",
   ).cursor()
   
   cursor.execute("SELECT * FROM make_me_corrupt.corrupt_me")
   
   # assert table is empty...
   results = cursor.fetchall()
   assert results == []
   
   # write a single row
   table.append(
       pa.Table.from_pylist([{"field1": 
"test_value"}]).cast(table.schema().as_arrow())
   )
   
   cursor.execute("SELECT * FROM make_me_corrupt.corrupt_me")
   results = cursor.fetchall()
   assert results == [("test_value",)]
   
   table.update_schema().add_column("col_name", StringType()).commit()
   
   cursor.execute("SELECT * FROM make_me_corrupt.corrupt_me")
   
   results = cursor.fetchall()
   assert results == [('test_value', None)]
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to