Skip to content

Commit

Permalink
PD-5304: alterCluster clusterBy behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
adrian-velonis1 committed Nov 27, 2024
1 parent fd6f796 commit b9e5d78
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Content/change-types/databricks/alter-cluster.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ <h2>Uses</h2>
<p>Clustered columns can help optimize performance for some database queries. If you have previously created a table with one or more clustered columns, you can modify which columns are clustered using <code class="language-text">alterCluster</code>. Specify which columns to cluster using <code>clusterBy</code>.</p>
<p>Changing which columns are clustered can be useful if your data changes significantly or if you begin using different filters to query your data. Better clustering can improve the read efficiency of the new queries.</p>
<p>Databricks does not allow you to drop tables containing clustered columns. You can use <code class="language-text">alterCluster</code> to remove clustering and then drop the table.</p>
<p class="tip" MadCap:autonum="&lt;b&gt;Tip: &lt;/b&gt;"><MadCap:variable name="General.Liquibase" /> does not automatically re-cluster table rows you update with <code class="language-text">alterCluster</code>. To do this, run <code><MadCap:xref href="optimize-table.html">optimizeTable</MadCap:xref></code> after altering your table.</p>
<p>For more information, see <a href="https://docs.databricks.com/en/delta/clustering.html">Use liquid clustering for Delta tables</a> and <a href="https://docs.databricks.com/en/sql/language-manual/sql-ref-syntax-ddl-alter-table.html">ALTER&#160;TABLE</a>.</p>
<h2>Run <code>alterCluster</code></h2>
<MadCap:snippetBlock src="../../Z_Resources/Snippets/text/change-type-run-syntax.flsnp" />
Expand Down Expand Up @@ -49,10 +48,10 @@ <h3><code>clusterBy</code>
</h3>
<p><b>Optional.</b>
</p>
<p>Specifies how to cluster the table.</p>
<p>Specifies how to cluster the table. Use this to remove clustering from a column.</p>
<p><code class="language-text">clusterBy</code> has the following nested attributes:</p>
<ul>
<li><code class="language-text">none</code> (Boolean) <b>(required)</b>: if <code class="language-text">true</code>, turns <b>off</b> clustering for the table being altered. If <code class="language-text">false</code>, turns <b>on</b> clustering.</li>
<li><code class="language-text">none</code> (Boolean) <b>(required)</b>: if <code class="language-text">true</code>, turns <b>off</b> clustering for the table being altered. If <code class="language-text">false</code>, <MadCap:variable name="General.Liquibase" /> throws an error.</li>
</ul>
<h3><code>columns</code>/<code>column</code></h3>
<p><b>Optional.</b>
Expand Down Expand Up @@ -141,6 +140,8 @@ <h2 id="examples">Examples</h2>
</div>
</div>
<MadCap:snippetBlock src="../../Z_Resources/Snippets/text/change-type-databricks-database-support.flsnp" />
<h2>Troubleshooting</h2>
<p>If you set the <code class="language-text">clusterBy</code>&#160;<MadCap:variable name="General.Param/Attribute" />&#160;<code class="language-text">none=false</code>, <MadCap:variable name="General.Liquibase" /> throws this error:</p><pre xml:space="preserve"><code class="language-text">Unexpected error running Liquibase: Error parsing line 13 column 49 of generated.xml: cvc-enumeration-valid: Value 'false' is not facet-valid with respect to enumeration '[true]'. It must be a value from the enumeration.</code></pre>
<h2>Related links</h2>
<ul>
<li><a href="https://docs.databricks.com/en/delta/clustering.html">Databricks: Use liquid clustering for Delta tables</a>
Expand Down

0 comments on commit b9e5d78

Please sign in to comment.