blob: 51b355f60c5fd684846e55354d430416aeca1fb6 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>SparkTableUtil</title>
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="SparkTableUtil";
}
}
catch(err) {
}
//-->
var methods = {"i0":9,"i1":9,"i2":9,"i3":9,"i4":9,"i5":9,"i6":9,"i7":9,"i8":9,"i9":9,"i10":41,"i11":41,"i12":9,"i13":9,"i14":9,"i15":9};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],8:["t4","Concrete Methods"],32:["t6","Deprecated Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/iceberg/spark/SparkStructLike.html" title="class in org.apache.iceberg.spark"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../org/apache/iceberg/spark/SparkTableUtil.SparkPartition.html" title="class in org.apache.iceberg.spark"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/iceberg/spark/SparkTableUtil.html" target="_top">Frames</a></li>
<li><a href="SparkTableUtil.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.iceberg.spark</div>
<h2 title="Class SparkTableUtil" class="title">Class SparkTableUtil</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.apache.iceberg.spark.SparkTableUtil</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="typeNameLabel">SparkTableUtil</span>
extends java.lang.Object</pre>
<div class="block">Java version of the original SparkTableUtil.scala
https://github.com/apache/iceberg/blob/apache-iceberg-0.8.0-incubating/spark/src/main/scala/org/apache/iceberg/spark/SparkTableUtil.scala</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested.class.summary">
<!-- -->
</a>
<h3>Nested Class Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation">
<caption><span>Nested Classes</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static class&nbsp;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/iceberg/spark/SparkTableUtil.SparkPartition.html" title="class in org.apache.iceberg.spark">SparkTableUtil.SparkPartition</a></span></code>
<div class="block">Class representing a table partition.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t6" class="tableTab"><span><a href="javascript:show(32);">Deprecated Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>static java.util.List&lt;<a href="../../../../org/apache/iceberg/spark/SparkTableUtil.SparkPartition.html" title="class in org.apache.iceberg.spark">SparkTableUtil.SparkPartition</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/iceberg/spark/SparkTableUtil.html#filterPartitions-java.util.List-java.util.Map-">filterPartitions</a></span>(java.util.List&lt;<a href="../../../../org/apache/iceberg/spark/SparkTableUtil.SparkPartition.html" title="class in org.apache.iceberg.spark">SparkTableUtil.SparkPartition</a>&gt;&nbsp;partitions,
java.util.Map&lt;java.lang.String,java.lang.String&gt;&nbsp;partitionFilter)</code>&nbsp;</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>static java.util.List&lt;<a href="../../../../org/apache/iceberg/spark/SparkTableUtil.SparkPartition.html" title="class in org.apache.iceberg.spark">SparkTableUtil.SparkPartition</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/iceberg/spark/SparkTableUtil.html#getPartitions-org.apache.spark.sql.SparkSession-java.lang.String-">getPartitions</a></span>(org.apache.spark.sql.SparkSession&nbsp;spark,
java.lang.String&nbsp;table)</code>
<div class="block">Returns all partitions in the table.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>static java.util.List&lt;<a href="../../../../org/apache/iceberg/spark/SparkTableUtil.SparkPartition.html" title="class in org.apache.iceberg.spark">SparkTableUtil.SparkPartition</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/iceberg/spark/SparkTableUtil.html#getPartitions-org.apache.spark.sql.SparkSession-org.apache.spark.sql.catalyst.TableIdentifier-java.util.Map-">getPartitions</a></span>(org.apache.spark.sql.SparkSession&nbsp;spark,
org.apache.spark.sql.catalyst.TableIdentifier&nbsp;tableIdent,
java.util.Map&lt;java.lang.String,java.lang.String&gt;&nbsp;partitionFilter)</code>
<div class="block">Returns all partitions in the table.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>static java.util.List&lt;<a href="../../../../org/apache/iceberg/spark/SparkTableUtil.SparkPartition.html" title="class in org.apache.iceberg.spark">SparkTableUtil.SparkPartition</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/iceberg/spark/SparkTableUtil.html#getPartitionsByFilter-org.apache.spark.sql.SparkSession-java.lang.String-java.lang.String-">getPartitionsByFilter</a></span>(org.apache.spark.sql.SparkSession&nbsp;spark,
java.lang.String&nbsp;table,
java.lang.String&nbsp;predicate)</code>
<div class="block">Returns partitions that match the specified 'predicate'.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>static java.util.List&lt;<a href="../../../../org/apache/iceberg/spark/SparkTableUtil.SparkPartition.html" title="class in org.apache.iceberg.spark">SparkTableUtil.SparkPartition</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/iceberg/spark/SparkTableUtil.html#getPartitionsByFilter-org.apache.spark.sql.SparkSession-org.apache.spark.sql.catalyst.TableIdentifier-org.apache.spark.sql.catalyst.expressions.Expression-">getPartitionsByFilter</a></span>(org.apache.spark.sql.SparkSession&nbsp;spark,
org.apache.spark.sql.catalyst.TableIdentifier&nbsp;tableIdent,
org.apache.spark.sql.catalyst.expressions.Expression&nbsp;predicateExpr)</code>
<div class="block">Returns partitions that match the specified 'predicate'.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/iceberg/spark/SparkTableUtil.html#importSparkPartitions-org.apache.spark.sql.SparkSession-java.util.List-org.apache.iceberg.Table-org.apache.iceberg.PartitionSpec-java.lang.String-">importSparkPartitions</a></span>(org.apache.spark.sql.SparkSession&nbsp;spark,
java.util.List&lt;<a href="../../../../org/apache/iceberg/spark/SparkTableUtil.SparkPartition.html" title="class in org.apache.iceberg.spark">SparkTableUtil.SparkPartition</a>&gt;&nbsp;partitions,
<a href="../../../../org/apache/iceberg/Table.html" title="interface in org.apache.iceberg">Table</a>&nbsp;targetTable,
<a href="../../../../org/apache/iceberg/PartitionSpec.html" title="class in org.apache.iceberg">PartitionSpec</a>&nbsp;spec,
java.lang.String&nbsp;stagingDir)</code>
<div class="block">Import files from given partitions to an Iceberg table.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/iceberg/spark/SparkTableUtil.html#importSparkPartitions-org.apache.spark.sql.SparkSession-java.util.List-org.apache.iceberg.Table-org.apache.iceberg.PartitionSpec-java.lang.String-boolean-">importSparkPartitions</a></span>(org.apache.spark.sql.SparkSession&nbsp;spark,
java.util.List&lt;<a href="../../../../org/apache/iceberg/spark/SparkTableUtil.SparkPartition.html" title="class in org.apache.iceberg.spark">SparkTableUtil.SparkPartition</a>&gt;&nbsp;partitions,
<a href="../../../../org/apache/iceberg/Table.html" title="interface in org.apache.iceberg">Table</a>&nbsp;targetTable,
<a href="../../../../org/apache/iceberg/PartitionSpec.html" title="class in org.apache.iceberg">PartitionSpec</a>&nbsp;spec,
java.lang.String&nbsp;stagingDir,
boolean&nbsp;checkDuplicateFiles)</code>
<div class="block">Import files from given partitions to an Iceberg table.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/iceberg/spark/SparkTableUtil.html#importSparkTable-org.apache.spark.sql.SparkSession-org.apache.spark.sql.catalyst.TableIdentifier-org.apache.iceberg.Table-java.lang.String-">importSparkTable</a></span>(org.apache.spark.sql.SparkSession&nbsp;spark,
org.apache.spark.sql.catalyst.TableIdentifier&nbsp;sourceTableIdent,
<a href="../../../../org/apache/iceberg/Table.html" title="interface in org.apache.iceberg">Table</a>&nbsp;targetTable,
java.lang.String&nbsp;stagingDir)</code>
<div class="block">Import files from an existing Spark table to an Iceberg table.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/iceberg/spark/SparkTableUtil.html#importSparkTable-org.apache.spark.sql.SparkSession-org.apache.spark.sql.catalyst.TableIdentifier-org.apache.iceberg.Table-java.lang.String-boolean-">importSparkTable</a></span>(org.apache.spark.sql.SparkSession&nbsp;spark,
org.apache.spark.sql.catalyst.TableIdentifier&nbsp;sourceTableIdent,
<a href="../../../../org/apache/iceberg/Table.html" title="interface in org.apache.iceberg">Table</a>&nbsp;targetTable,
java.lang.String&nbsp;stagingDir,
boolean&nbsp;checkDuplicateFiles)</code>
<div class="block">Import files from an existing Spark table to an Iceberg table.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/iceberg/spark/SparkTableUtil.html#importSparkTable-org.apache.spark.sql.SparkSession-org.apache.spark.sql.catalyst.TableIdentifier-org.apache.iceberg.Table-java.lang.String-java.util.Map-boolean-">importSparkTable</a></span>(org.apache.spark.sql.SparkSession&nbsp;spark,
org.apache.spark.sql.catalyst.TableIdentifier&nbsp;sourceTableIdent,
<a href="../../../../org/apache/iceberg/Table.html" title="interface in org.apache.iceberg">Table</a>&nbsp;targetTable,
java.lang.String&nbsp;stagingDir,
java.util.Map&lt;java.lang.String,java.lang.String&gt;&nbsp;partitionFilter,
boolean&nbsp;checkDuplicateFiles)</code>
<div class="block">Import files from an existing Spark table to an Iceberg table.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>static java.util.List&lt;<a href="../../../../org/apache/iceberg/DataFile.html" title="interface in org.apache.iceberg">DataFile</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/iceberg/spark/SparkTableUtil.html#listPartition-org.apache.iceberg.spark.SparkTableUtil.SparkPartition-org.apache.iceberg.PartitionSpec-org.apache.iceberg.hadoop.SerializableConfiguration-org.apache.iceberg.MetricsConfig-">listPartition</a></span>(<a href="../../../../org/apache/iceberg/spark/SparkTableUtil.SparkPartition.html" title="class in org.apache.iceberg.spark">SparkTableUtil.SparkPartition</a>&nbsp;partition,
<a href="../../../../org/apache/iceberg/PartitionSpec.html" title="class in org.apache.iceberg">PartitionSpec</a>&nbsp;spec,
<a href="../../../../org/apache/iceberg/hadoop/SerializableConfiguration.html" title="class in org.apache.iceberg.hadoop">SerializableConfiguration</a>&nbsp;conf,
<a href="../../../../org/apache/iceberg/MetricsConfig.html" title="class in org.apache.iceberg">MetricsConfig</a>&nbsp;metricsConfig)</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;
<div class="block"><span class="deprecationComment">use <a href="../../../../org/apache/iceberg/data/TableMigrationUtil.html#listPartition-java.util.Map-java.lang.String-java.lang.String-org.apache.iceberg.PartitionSpec-org.apache.hadoop.conf.Configuration-org.apache.iceberg.MetricsConfig-org.apache.iceberg.mapping.NameMapping-"><code>TableMigrationUtil.listPartition(Map, String, String, PartitionSpec, Configuration,
MetricsConfig, NameMapping)</code></a></span></div>
</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>static java.util.List&lt;<a href="../../../../org/apache/iceberg/DataFile.html" title="interface in org.apache.iceberg">DataFile</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/iceberg/spark/SparkTableUtil.html#listPartition-org.apache.iceberg.spark.SparkTableUtil.SparkPartition-org.apache.iceberg.PartitionSpec-org.apache.iceberg.hadoop.SerializableConfiguration-org.apache.iceberg.MetricsConfig-org.apache.iceberg.mapping.NameMapping-">listPartition</a></span>(<a href="../../../../org/apache/iceberg/spark/SparkTableUtil.SparkPartition.html" title="class in org.apache.iceberg.spark">SparkTableUtil.SparkPartition</a>&nbsp;partition,
<a href="../../../../org/apache/iceberg/PartitionSpec.html" title="class in org.apache.iceberg">PartitionSpec</a>&nbsp;spec,
<a href="../../../../org/apache/iceberg/hadoop/SerializableConfiguration.html" title="class in org.apache.iceberg.hadoop">SerializableConfiguration</a>&nbsp;conf,
<a href="../../../../org/apache/iceberg/MetricsConfig.html" title="class in org.apache.iceberg">MetricsConfig</a>&nbsp;metricsConfig,
<a href="../../../../org/apache/iceberg/mapping/NameMapping.html" title="class in org.apache.iceberg.mapping">NameMapping</a>&nbsp;mapping)</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;
<div class="block"><span class="deprecationComment">use <a href="../../../../org/apache/iceberg/data/TableMigrationUtil.html#listPartition-java.util.Map-java.lang.String-java.lang.String-org.apache.iceberg.PartitionSpec-org.apache.hadoop.conf.Configuration-org.apache.iceberg.MetricsConfig-org.apache.iceberg.mapping.NameMapping-"><code>TableMigrationUtil.listPartition(Map, String, String, PartitionSpec, Configuration,
MetricsConfig, NameMapping)</code></a></span></div>
</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>static org.apache.spark.sql.Dataset&lt;org.apache.spark.sql.Row&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/iceberg/spark/SparkTableUtil.html#loadCatalogMetadataTable-org.apache.spark.sql.SparkSession-org.apache.iceberg.Table-org.apache.iceberg.MetadataTableType-">loadCatalogMetadataTable</a></span>(org.apache.spark.sql.SparkSession&nbsp;spark,
<a href="../../../../org/apache/iceberg/Table.html" title="interface in org.apache.iceberg">Table</a>&nbsp;table,
<a href="../../../../org/apache/iceberg/MetadataTableType.html" title="enum in org.apache.iceberg">MetadataTableType</a>&nbsp;type)</code>&nbsp;</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>static org.apache.spark.sql.Dataset&lt;org.apache.spark.sql.Row&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/iceberg/spark/SparkTableUtil.html#loadMetadataTable-org.apache.spark.sql.SparkSession-org.apache.iceberg.Table-org.apache.iceberg.MetadataTableType-">loadMetadataTable</a></span>(org.apache.spark.sql.SparkSession&nbsp;spark,
<a href="../../../../org/apache/iceberg/Table.html" title="interface in org.apache.iceberg">Table</a>&nbsp;table,
<a href="../../../../org/apache/iceberg/MetadataTableType.html" title="enum in org.apache.iceberg">MetadataTableType</a>&nbsp;type)</code>&nbsp;</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>static org.apache.spark.sql.Dataset&lt;org.apache.spark.sql.Row&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/iceberg/spark/SparkTableUtil.html#partitionDF-org.apache.spark.sql.SparkSession-java.lang.String-">partitionDF</a></span>(org.apache.spark.sql.SparkSession&nbsp;spark,
java.lang.String&nbsp;table)</code>
<div class="block">Returns a DataFrame with a row for each partition in the table.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>static org.apache.spark.sql.Dataset&lt;org.apache.spark.sql.Row&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/iceberg/spark/SparkTableUtil.html#partitionDFByFilter-org.apache.spark.sql.SparkSession-java.lang.String-java.lang.String-">partitionDFByFilter</a></span>(org.apache.spark.sql.SparkSession&nbsp;spark,
java.lang.String&nbsp;table,
java.lang.String&nbsp;expression)</code>
<div class="block">Returns a DataFrame with a row for each partition that matches the specified 'expression'.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="partitionDF-org.apache.spark.sql.SparkSession-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>partitionDF</h4>
<pre>public static&nbsp;org.apache.spark.sql.Dataset&lt;org.apache.spark.sql.Row&gt;&nbsp;partitionDF(org.apache.spark.sql.SparkSession&nbsp;spark,
java.lang.String&nbsp;table)</pre>
<div class="block">Returns a DataFrame with a row for each partition in the table.
The DataFrame has 3 columns, partition key (a=1/b=2), partition location, and format
(avro or parquet).</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>spark</code> - a Spark session</dd>
<dd><code>table</code> - a table name and (optional) database</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a DataFrame of the table's partitions</dd>
</dl>
</li>
</ul>
<a name="partitionDFByFilter-org.apache.spark.sql.SparkSession-java.lang.String-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>partitionDFByFilter</h4>
<pre>public static&nbsp;org.apache.spark.sql.Dataset&lt;org.apache.spark.sql.Row&gt;&nbsp;partitionDFByFilter(org.apache.spark.sql.SparkSession&nbsp;spark,
java.lang.String&nbsp;table,
java.lang.String&nbsp;expression)</pre>
<div class="block">Returns a DataFrame with a row for each partition that matches the specified 'expression'.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>spark</code> - a Spark session.</dd>
<dd><code>table</code> - name of the table.</dd>
<dd><code>expression</code> - The expression whose matching partitions are returned.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a DataFrame of the table partitions.</dd>
</dl>
</li>
</ul>
<a name="getPartitions-org.apache.spark.sql.SparkSession-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPartitions</h4>
<pre>public static&nbsp;java.util.List&lt;<a href="../../../../org/apache/iceberg/spark/SparkTableUtil.SparkPartition.html" title="class in org.apache.iceberg.spark">SparkTableUtil.SparkPartition</a>&gt;&nbsp;getPartitions(org.apache.spark.sql.SparkSession&nbsp;spark,
java.lang.String&nbsp;table)</pre>
<div class="block">Returns all partitions in the table.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>spark</code> - a Spark session</dd>
<dd><code>table</code> - a table name and (optional) database</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>all table's partitions</dd>
</dl>
</li>
</ul>
<a name="getPartitions-org.apache.spark.sql.SparkSession-org.apache.spark.sql.catalyst.TableIdentifier-java.util.Map-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPartitions</h4>
<pre>public static&nbsp;java.util.List&lt;<a href="../../../../org/apache/iceberg/spark/SparkTableUtil.SparkPartition.html" title="class in org.apache.iceberg.spark">SparkTableUtil.SparkPartition</a>&gt;&nbsp;getPartitions(org.apache.spark.sql.SparkSession&nbsp;spark,
org.apache.spark.sql.catalyst.TableIdentifier&nbsp;tableIdent,
java.util.Map&lt;java.lang.String,java.lang.String&gt;&nbsp;partitionFilter)</pre>
<div class="block">Returns all partitions in the table.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>spark</code> - a Spark session</dd>
<dd><code>tableIdent</code> - a table identifier</dd>
<dd><code>partitionFilter</code> - partition filter, or null if no filter</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>all table's partitions</dd>
</dl>
</li>
</ul>
<a name="getPartitionsByFilter-org.apache.spark.sql.SparkSession-java.lang.String-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPartitionsByFilter</h4>
<pre>public static&nbsp;java.util.List&lt;<a href="../../../../org/apache/iceberg/spark/SparkTableUtil.SparkPartition.html" title="class in org.apache.iceberg.spark">SparkTableUtil.SparkPartition</a>&gt;&nbsp;getPartitionsByFilter(org.apache.spark.sql.SparkSession&nbsp;spark,
java.lang.String&nbsp;table,
java.lang.String&nbsp;predicate)</pre>
<div class="block">Returns partitions that match the specified 'predicate'.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>spark</code> - a Spark session</dd>
<dd><code>table</code> - a table name and (optional) database</dd>
<dd><code>predicate</code> - a predicate on partition columns</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>matching table's partitions</dd>
</dl>
</li>
</ul>
<a name="getPartitionsByFilter-org.apache.spark.sql.SparkSession-org.apache.spark.sql.catalyst.TableIdentifier-org.apache.spark.sql.catalyst.expressions.Expression-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPartitionsByFilter</h4>
<pre>public static&nbsp;java.util.List&lt;<a href="../../../../org/apache/iceberg/spark/SparkTableUtil.SparkPartition.html" title="class in org.apache.iceberg.spark">SparkTableUtil.SparkPartition</a>&gt;&nbsp;getPartitionsByFilter(org.apache.spark.sql.SparkSession&nbsp;spark,
org.apache.spark.sql.catalyst.TableIdentifier&nbsp;tableIdent,
org.apache.spark.sql.catalyst.expressions.Expression&nbsp;predicateExpr)</pre>
<div class="block">Returns partitions that match the specified 'predicate'.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>spark</code> - a Spark session</dd>
<dd><code>tableIdent</code> - a table identifier</dd>
<dd><code>predicateExpr</code> - a predicate expression on partition columns</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>matching table's partitions</dd>
</dl>
</li>
</ul>
<a name="listPartition-org.apache.iceberg.spark.SparkTableUtil.SparkPartition-org.apache.iceberg.PartitionSpec-org.apache.iceberg.hadoop.SerializableConfiguration-org.apache.iceberg.MetricsConfig-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>listPartition</h4>
<pre>@Deprecated
public static&nbsp;java.util.List&lt;<a href="../../../../org/apache/iceberg/DataFile.html" title="interface in org.apache.iceberg">DataFile</a>&gt;&nbsp;listPartition(<a href="../../../../org/apache/iceberg/spark/SparkTableUtil.SparkPartition.html" title="class in org.apache.iceberg.spark">SparkTableUtil.SparkPartition</a>&nbsp;partition,
<a href="../../../../org/apache/iceberg/PartitionSpec.html" title="class in org.apache.iceberg">PartitionSpec</a>&nbsp;spec,
<a href="../../../../org/apache/iceberg/hadoop/SerializableConfiguration.html" title="class in org.apache.iceberg.hadoop">SerializableConfiguration</a>&nbsp;conf,
<a href="../../../../org/apache/iceberg/MetricsConfig.html" title="class in org.apache.iceberg">MetricsConfig</a>&nbsp;metricsConfig)</pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;<span class="deprecationComment">use <a href="../../../../org/apache/iceberg/data/TableMigrationUtil.html#listPartition-java.util.Map-java.lang.String-java.lang.String-org.apache.iceberg.PartitionSpec-org.apache.hadoop.conf.Configuration-org.apache.iceberg.MetricsConfig-org.apache.iceberg.mapping.NameMapping-"><code>TableMigrationUtil.listPartition(Map, String, String, PartitionSpec, Configuration,
MetricsConfig, NameMapping)</code></a></span></div>
<div class="block">Returns the data files in a partition by listing the partition location.
For Parquet and ORC partitions, this will read metrics from the file footer. For Avro partitions,
metrics are set to null.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>partition</code> - a partition</dd>
<dd><code>conf</code> - a serializable Hadoop conf</dd>
<dd><code>metricsConfig</code> - a metrics conf</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a List of DataFile</dd>
</dl>
</li>
</ul>
<a name="listPartition-org.apache.iceberg.spark.SparkTableUtil.SparkPartition-org.apache.iceberg.PartitionSpec-org.apache.iceberg.hadoop.SerializableConfiguration-org.apache.iceberg.MetricsConfig-org.apache.iceberg.mapping.NameMapping-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>listPartition</h4>
<pre>@Deprecated
public static&nbsp;java.util.List&lt;<a href="../../../../org/apache/iceberg/DataFile.html" title="interface in org.apache.iceberg">DataFile</a>&gt;&nbsp;listPartition(<a href="../../../../org/apache/iceberg/spark/SparkTableUtil.SparkPartition.html" title="class in org.apache.iceberg.spark">SparkTableUtil.SparkPartition</a>&nbsp;partition,
<a href="../../../../org/apache/iceberg/PartitionSpec.html" title="class in org.apache.iceberg">PartitionSpec</a>&nbsp;spec,
<a href="../../../../org/apache/iceberg/hadoop/SerializableConfiguration.html" title="class in org.apache.iceberg.hadoop">SerializableConfiguration</a>&nbsp;conf,
<a href="../../../../org/apache/iceberg/MetricsConfig.html" title="class in org.apache.iceberg">MetricsConfig</a>&nbsp;metricsConfig,
<a href="../../../../org/apache/iceberg/mapping/NameMapping.html" title="class in org.apache.iceberg.mapping">NameMapping</a>&nbsp;mapping)</pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;<span class="deprecationComment">use <a href="../../../../org/apache/iceberg/data/TableMigrationUtil.html#listPartition-java.util.Map-java.lang.String-java.lang.String-org.apache.iceberg.PartitionSpec-org.apache.hadoop.conf.Configuration-org.apache.iceberg.MetricsConfig-org.apache.iceberg.mapping.NameMapping-"><code>TableMigrationUtil.listPartition(Map, String, String, PartitionSpec, Configuration,
MetricsConfig, NameMapping)</code></a></span></div>
<div class="block">Returns the data files in a partition by listing the partition location.
For Parquet and ORC partitions, this will read metrics from the file footer. For Avro partitions,
metrics are set to null.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>partition</code> - a partition</dd>
<dd><code>conf</code> - a serializable Hadoop conf</dd>
<dd><code>metricsConfig</code> - a metrics conf</dd>
<dd><code>mapping</code> - a name mapping</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a List of DataFile</dd>
</dl>
</li>
</ul>
<a name="importSparkTable-org.apache.spark.sql.SparkSession-org.apache.spark.sql.catalyst.TableIdentifier-org.apache.iceberg.Table-java.lang.String-java.util.Map-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>importSparkTable</h4>
<pre>public static&nbsp;void&nbsp;importSparkTable(org.apache.spark.sql.SparkSession&nbsp;spark,
org.apache.spark.sql.catalyst.TableIdentifier&nbsp;sourceTableIdent,
<a href="../../../../org/apache/iceberg/Table.html" title="interface in org.apache.iceberg">Table</a>&nbsp;targetTable,
java.lang.String&nbsp;stagingDir,
java.util.Map&lt;java.lang.String,java.lang.String&gt;&nbsp;partitionFilter,
boolean&nbsp;checkDuplicateFiles)</pre>
<div class="block">Import files from an existing Spark table to an Iceberg table.
The import uses the Spark session to get table metadata. It assumes no
operation is going on the original and target table and thus is not
thread-safe.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>spark</code> - a Spark session</dd>
<dd><code>sourceTableIdent</code> - an identifier of the source Spark table</dd>
<dd><code>targetTable</code> - an Iceberg table where to import the data</dd>
<dd><code>stagingDir</code> - a staging directory to store temporary manifest files</dd>
<dd><code>partitionFilter</code> - only import partitions whose values match those in the map, can be partially defined</dd>
<dd><code>checkDuplicateFiles</code> - if true, throw exception if import results in a duplicate data file</dd>
</dl>
</li>
</ul>
<a name="importSparkTable-org.apache.spark.sql.SparkSession-org.apache.spark.sql.catalyst.TableIdentifier-org.apache.iceberg.Table-java.lang.String-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>importSparkTable</h4>
<pre>public static&nbsp;void&nbsp;importSparkTable(org.apache.spark.sql.SparkSession&nbsp;spark,
org.apache.spark.sql.catalyst.TableIdentifier&nbsp;sourceTableIdent,
<a href="../../../../org/apache/iceberg/Table.html" title="interface in org.apache.iceberg">Table</a>&nbsp;targetTable,
java.lang.String&nbsp;stagingDir,
boolean&nbsp;checkDuplicateFiles)</pre>
<div class="block">Import files from an existing Spark table to an Iceberg table.
The import uses the Spark session to get table metadata. It assumes no
operation is going on the original and target table and thus is not
thread-safe.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>spark</code> - a Spark session</dd>
<dd><code>sourceTableIdent</code> - an identifier of the source Spark table</dd>
<dd><code>targetTable</code> - an Iceberg table where to import the data</dd>
<dd><code>stagingDir</code> - a staging directory to store temporary manifest files</dd>
<dd><code>checkDuplicateFiles</code> - if true, throw exception if import results in a duplicate data file</dd>
</dl>
</li>
</ul>
<a name="importSparkTable-org.apache.spark.sql.SparkSession-org.apache.spark.sql.catalyst.TableIdentifier-org.apache.iceberg.Table-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>importSparkTable</h4>
<pre>public static&nbsp;void&nbsp;importSparkTable(org.apache.spark.sql.SparkSession&nbsp;spark,
org.apache.spark.sql.catalyst.TableIdentifier&nbsp;sourceTableIdent,
<a href="../../../../org/apache/iceberg/Table.html" title="interface in org.apache.iceberg">Table</a>&nbsp;targetTable,
java.lang.String&nbsp;stagingDir)</pre>
<div class="block">Import files from an existing Spark table to an Iceberg table.
The import uses the Spark session to get table metadata. It assumes no
operation is going on the original and target table and thus is not
thread-safe.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>spark</code> - a Spark session</dd>
<dd><code>sourceTableIdent</code> - an identifier of the source Spark table</dd>
<dd><code>targetTable</code> - an Iceberg table where to import the data</dd>
<dd><code>stagingDir</code> - a staging directory to store temporary manifest files</dd>
</dl>
</li>
</ul>
<a name="importSparkPartitions-org.apache.spark.sql.SparkSession-java.util.List-org.apache.iceberg.Table-org.apache.iceberg.PartitionSpec-java.lang.String-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>importSparkPartitions</h4>
<pre>public static&nbsp;void&nbsp;importSparkPartitions(org.apache.spark.sql.SparkSession&nbsp;spark,
java.util.List&lt;<a href="../../../../org/apache/iceberg/spark/SparkTableUtil.SparkPartition.html" title="class in org.apache.iceberg.spark">SparkTableUtil.SparkPartition</a>&gt;&nbsp;partitions,
<a href="../../../../org/apache/iceberg/Table.html" title="interface in org.apache.iceberg">Table</a>&nbsp;targetTable,
<a href="../../../../org/apache/iceberg/PartitionSpec.html" title="class in org.apache.iceberg">PartitionSpec</a>&nbsp;spec,
java.lang.String&nbsp;stagingDir,
boolean&nbsp;checkDuplicateFiles)</pre>
<div class="block">Import files from given partitions to an Iceberg table.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>spark</code> - a Spark session</dd>
<dd><code>partitions</code> - partitions to import</dd>
<dd><code>targetTable</code> - an Iceberg table where to import the data</dd>
<dd><code>spec</code> - a partition spec</dd>
<dd><code>stagingDir</code> - a staging directory to store temporary manifest files</dd>
<dd><code>checkDuplicateFiles</code> - if true, throw exception if import results in a duplicate data file</dd>
</dl>
</li>
</ul>
<a name="importSparkPartitions-org.apache.spark.sql.SparkSession-java.util.List-org.apache.iceberg.Table-org.apache.iceberg.PartitionSpec-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>importSparkPartitions</h4>
<pre>public static&nbsp;void&nbsp;importSparkPartitions(org.apache.spark.sql.SparkSession&nbsp;spark,
java.util.List&lt;<a href="../../../../org/apache/iceberg/spark/SparkTableUtil.SparkPartition.html" title="class in org.apache.iceberg.spark">SparkTableUtil.SparkPartition</a>&gt;&nbsp;partitions,
<a href="../../../../org/apache/iceberg/Table.html" title="interface in org.apache.iceberg">Table</a>&nbsp;targetTable,
<a href="../../../../org/apache/iceberg/PartitionSpec.html" title="class in org.apache.iceberg">PartitionSpec</a>&nbsp;spec,
java.lang.String&nbsp;stagingDir)</pre>
<div class="block">Import files from given partitions to an Iceberg table.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>spark</code> - a Spark session</dd>
<dd><code>partitions</code> - partitions to import</dd>
<dd><code>targetTable</code> - an Iceberg table where to import the data</dd>
<dd><code>spec</code> - a partition spec</dd>
<dd><code>stagingDir</code> - a staging directory to store temporary manifest files</dd>
</dl>
</li>
</ul>
<a name="filterPartitions-java.util.List-java.util.Map-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>filterPartitions</h4>
<pre>public static&nbsp;java.util.List&lt;<a href="../../../../org/apache/iceberg/spark/SparkTableUtil.SparkPartition.html" title="class in org.apache.iceberg.spark">SparkTableUtil.SparkPartition</a>&gt;&nbsp;filterPartitions(java.util.List&lt;<a href="../../../../org/apache/iceberg/spark/SparkTableUtil.SparkPartition.html" title="class in org.apache.iceberg.spark">SparkTableUtil.SparkPartition</a>&gt;&nbsp;partitions,
java.util.Map&lt;java.lang.String,java.lang.String&gt;&nbsp;partitionFilter)</pre>
</li>
</ul>
<a name="loadCatalogMetadataTable-org.apache.spark.sql.SparkSession-org.apache.iceberg.Table-org.apache.iceberg.MetadataTableType-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>loadCatalogMetadataTable</h4>
<pre>public static&nbsp;org.apache.spark.sql.Dataset&lt;org.apache.spark.sql.Row&gt;&nbsp;loadCatalogMetadataTable(org.apache.spark.sql.SparkSession&nbsp;spark,
<a href="../../../../org/apache/iceberg/Table.html" title="interface in org.apache.iceberg">Table</a>&nbsp;table,
<a href="../../../../org/apache/iceberg/MetadataTableType.html" title="enum in org.apache.iceberg">MetadataTableType</a>&nbsp;type)</pre>
</li>
</ul>
<a name="loadMetadataTable-org.apache.spark.sql.SparkSession-org.apache.iceberg.Table-org.apache.iceberg.MetadataTableType-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>loadMetadataTable</h4>
<pre>public static&nbsp;org.apache.spark.sql.Dataset&lt;org.apache.spark.sql.Row&gt;&nbsp;loadMetadataTable(org.apache.spark.sql.SparkSession&nbsp;spark,
<a href="../../../../org/apache/iceberg/Table.html" title="interface in org.apache.iceberg">Table</a>&nbsp;table,
<a href="../../../../org/apache/iceberg/MetadataTableType.html" title="enum in org.apache.iceberg">MetadataTableType</a>&nbsp;type)</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/iceberg/spark/SparkStructLike.html" title="class in org.apache.iceberg.spark"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../org/apache/iceberg/spark/SparkTableUtil.SparkPartition.html" title="class in org.apache.iceberg.spark"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/iceberg/spark/SparkTableUtil.html" target="_top">Frames</a></li>
<li><a href="SparkTableUtil.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>