10-14-2022 01:29 PM
I predefined my schema for a Delta Live Table Autoload. This included comments for some attributes. When performing a standard readStream, my comments appear, but when in Delta Live Tables I get no comments. Is there anything I need to do get comments to appear?
Schema definition:
schema = StructType([
StructField("uuid",StringType(),True, {'comment': "Unique customer id"}),
StructField("GPS",StringType(),True)])
Delta Live Table Stream:
@dlt.table(name="test_bronze",
comment = "test account data incrementally ingested from S3 Raw landing zone",
table_properties={
"quality": "bronze"
}
)
# Stream data
#@dlt.table
def test_bronze():
return (
spark.readStream
.format("cloudFiles")
.option("cloudFiles.format", "csv)
.option("header", "True")
.schema(schema)
.load(data_source)
)
But no comments in data:
10-20-2022 06:24 AM
You need to add your schema to dlt declaration:
@dlt.table(
name="test_bronze",
comment = "test account data incrementally ingested from S3 Raw landing zone",
table_properties={ "quality": "bronze" },
schema=schema)
10-18-2022 05:53 AM
Hi @Dave Wilson , are you getting any error for the same?
You can include comments.
Delta Live Tables automatically captures the dependencies between datasets defined in your pipeline and uses this dependency information to determine the execution order when performing an update and to record lineage information in the event log for a pipeline.
Both views and tables have the following optional properties:
Please refer https://docs.databricks.com/workflows/delta-live-tables/delta-live-tables-sql-ref.html#sql-datasets
10-20-2022 06:24 AM
You need to add your schema to dlt declaration:
@dlt.table(
name="test_bronze",
comment = "test account data incrementally ingested from S3 Raw landing zone",
table_properties={ "quality": "bronze" },
schema=schema)
02-06-2023 03:16 AM
what does adding table_properties do again? any links to the documentation?
03-09-2023 03:58 AM
table_properties are optional parameters that you can use to configure various aspects of your Delta Live Tables, such as optimization, partitioning, and retention and also set own custom tags.
You can find more details about table_properties and their possible values in Table properties - https://learn.microsoft.com/en-us/azure/databricks/workflows/delta-live-tables/dlt-table-properties
Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.
If there isn’t a group near you, start one and help create a community that brings people together.
Request a New Group