Skip to content

[feature request] easier API to set table properties  #502

@kevinjqliu

Description

@kevinjqliu

Feature Request / Improvement

Background

Currently, there are two ways to set table properties.

  1. in create_table, pass in properties as dictionary

    table = catalog.create_table(random_identifier, table_schema_nested, properties={"format-version": "1"})

  2. using table set_properties transaction, pass in as key/value pair

    with table.transaction() as transaction:
    transaction.set_properties(abc="def")

With the introduction of TableProperties, it would be great to make overriding table properties easier.
With the current methods, we can only override table properties during create_table since this is not valid python:

with table.transaction() as transaction: 
    transaction.set_properties(TableProperties.PARQUET_ROW_GROUP_SIZE_BYTES=1000) 

Proposed solution

Allow set_properties to take in a dictionary. And also allow the dictionary value to be non-string type (similar to #469)

with table.transaction() as transaction: 
    transaction.set_properties({TableProperties.PARQUET_ROW_GROUP_SIZE_BYTES: 1000}) 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions