<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Liquid Clustering on a Feature Store Table Created with FeatureEngineeringClient in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/liquid-clustering-on-a-feature-store-table-created-with/m-p/88260#M37520</link>
    <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I'm exploring ways to perform clustering on a feature store table that I've created using the FeatureEngineeringClient in Databricks, and I'm particularly interested in applying &lt;STRONG&gt;liquid clustering&lt;/STRONG&gt; to one of the columns.&lt;/P&gt;&lt;P&gt;Here’s the scenario:&lt;/P&gt;&lt;P&gt;I created a feature store table using the following code:&lt;/P&gt;&lt;P&gt;from databricks.feature_engineering import FeatureEngineeringClient, FeatureLookup&lt;/P&gt;&lt;P&gt;# Initialize the FeatureEngineeringClient&lt;BR /&gt;fe = FeatureEngineeringClient()&lt;/P&gt;&lt;P&gt;# Define the feature store table with primary key and schema&lt;BR /&gt;fe.create_table(&lt;BR /&gt;name=table_name,&lt;BR /&gt;primary_keys=["wine_id"],&lt;BR /&gt;schema=features_df.schema,&lt;BR /&gt;description="wine features"&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;# Write data to the feature store table&lt;BR /&gt;fe.write_table(&lt;BR /&gt;name=table_name,&lt;BR /&gt;df=features_df,&lt;BR /&gt;mode="merge"&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;Now that I have the feature store table in place with various features, I'd like to apply &lt;STRONG&gt;liquid clustering&lt;/STRONG&gt; to one of the columns (or multiple columns).&lt;/P&gt;&lt;H3&gt;My Question:&lt;/H3&gt;&lt;P&gt;How can I implement &lt;STRONG&gt;liquid clustering&lt;/STRONG&gt; on this feature store table in Python? I know that I can enable liquid clustering on an existing unpartitioned Delta table using the following syntax:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;ALTER&lt;/SPAN&gt; &lt;SPAN class=""&gt;TABLE&lt;/SPAN&gt; &amp;lt;table_name&amp;gt;
CLUSTER &lt;SPAN class=""&gt;BY&lt;/SPAN&gt; (&amp;lt;clustering_columns&amp;gt;)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;but that requires SQL.&lt;/P&gt;&lt;P&gt;Any help or code examples on this would be greatly appreciated!&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
    <pubDate>Wed, 04 Sep 2024 09:56:04 GMT</pubDate>
    <dc:creator>Direo</dc:creator>
    <dc:date>2024-09-04T09:56:04Z</dc:date>
    <item>
      <title>Liquid Clustering on a Feature Store Table Created with FeatureEngineeringClient</title>
      <link>https://community.databricks.com/t5/data-engineering/liquid-clustering-on-a-feature-store-table-created-with/m-p/88260#M37520</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I'm exploring ways to perform clustering on a feature store table that I've created using the FeatureEngineeringClient in Databricks, and I'm particularly interested in applying &lt;STRONG&gt;liquid clustering&lt;/STRONG&gt; to one of the columns.&lt;/P&gt;&lt;P&gt;Here’s the scenario:&lt;/P&gt;&lt;P&gt;I created a feature store table using the following code:&lt;/P&gt;&lt;P&gt;from databricks.feature_engineering import FeatureEngineeringClient, FeatureLookup&lt;/P&gt;&lt;P&gt;# Initialize the FeatureEngineeringClient&lt;BR /&gt;fe = FeatureEngineeringClient()&lt;/P&gt;&lt;P&gt;# Define the feature store table with primary key and schema&lt;BR /&gt;fe.create_table(&lt;BR /&gt;name=table_name,&lt;BR /&gt;primary_keys=["wine_id"],&lt;BR /&gt;schema=features_df.schema,&lt;BR /&gt;description="wine features"&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;# Write data to the feature store table&lt;BR /&gt;fe.write_table(&lt;BR /&gt;name=table_name,&lt;BR /&gt;df=features_df,&lt;BR /&gt;mode="merge"&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;Now that I have the feature store table in place with various features, I'd like to apply &lt;STRONG&gt;liquid clustering&lt;/STRONG&gt; to one of the columns (or multiple columns).&lt;/P&gt;&lt;H3&gt;My Question:&lt;/H3&gt;&lt;P&gt;How can I implement &lt;STRONG&gt;liquid clustering&lt;/STRONG&gt; on this feature store table in Python? I know that I can enable liquid clustering on an existing unpartitioned Delta table using the following syntax:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;ALTER&lt;/SPAN&gt; &lt;SPAN class=""&gt;TABLE&lt;/SPAN&gt; &amp;lt;table_name&amp;gt;
CLUSTER &lt;SPAN class=""&gt;BY&lt;/SPAN&gt; (&amp;lt;clustering_columns&amp;gt;)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;but that requires SQL.&lt;/P&gt;&lt;P&gt;Any help or code examples on this would be greatly appreciated!&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2024 09:56:04 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/liquid-clustering-on-a-feature-store-table-created-with/m-p/88260#M37520</guid>
      <dc:creator>Direo</dc:creator>
      <dc:date>2024-09-04T09:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: Liquid Clustering on a Feature Store Table Created with FeatureEngineeringClient</title>
      <link>https://community.databricks.com/t5/data-engineering/liquid-clustering-on-a-feature-store-table-created-with/m-p/101438#M40665</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;# Set the table name and clustering columns
table_name = "feature_store_table"
clustering_columns = ["column1", "column2"]

# Build the SQL command
sql_command = f"ALTER TABLE {table_name} CLUSTER BY ({', '.join(clustering_columns)})"

# Execute the SQL command
spark.sql(sql_command)&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 09 Dec 2024 08:58:49 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/liquid-clustering-on-a-feature-store-table-created-with/m-p/101438#M40665</guid>
      <dc:creator>Sidhant07</dc:creator>
      <dc:date>2024-12-09T08:58:49Z</dc:date>
    </item>
  </channel>
</rss>

