@@ -18,6 +18,7 @@ namespace Microsoft.Spark.Extensions.Delta.Tables
1818 /// DeltaTable.ForPath(sparkSession, pathToTheDeltaTable)
1919 /// </code>
2020 /// </summary>
21+ [ DeltaLakeSince ( DeltaLakeVersions . V0_3_0 ) ]
2122 public class DeltaTable : IJvmObjectReferenceProvider
2223 {
2324 private readonly JvmObjectReference _jvmObject ;
@@ -56,6 +57,7 @@ internal DeltaTable(JvmObjectReference jvmObject)
5657 /// <param name="identifier">String used to identify the parquet table.</param>
5758 /// <param name="partitionSchema">StructType representing the partition schema.</param>
5859 /// <returns>The converted DeltaTable.</returns>
60+ [ DeltaLakeSince ( DeltaLakeVersions . V0_4_0 ) ]
5961 public static DeltaTable ConvertToDelta (
6062 SparkSession spark ,
6163 string identifier ,
@@ -86,6 +88,7 @@ public static DeltaTable ConvertToDelta(
8688 /// <param name="identifier">String used to identify the parquet table.</param>
8789 /// <param name="partitionSchema">String representing the partition schema.</param>
8890 /// <returns>The converted DeltaTable.</returns>
91+ [ DeltaLakeSince ( DeltaLakeVersions . V0_4_0 ) ]
8992 public static DeltaTable ConvertToDelta (
9093 SparkSession spark ,
9194 string identifier ,
@@ -114,6 +117,7 @@ public static DeltaTable ConvertToDelta(
114117 /// <param name="spark">The relevant session.</param>
115118 /// <param name="identifier">String used to identify the parquet table.</param>
116119 /// <returns>The converted DeltaTable.</returns>
120+ [ DeltaLakeSince ( DeltaLakeVersions . V0_4_0 ) ]
117121 public static DeltaTable ConvertToDelta ( SparkSession spark , string identifier ) =>
118122 new DeltaTable (
119123 ( JvmObjectReference ) SparkEnvironment . JvmBridge . CallStaticJavaMethod (
@@ -131,6 +135,7 @@ public static DeltaTable ConvertToDelta(SparkSession spark, string identifier) =
131135 /// </summary>
132136 /// <param name="path">The path to the data.</param>
133137 /// <returns>DeltaTable loaded from the path.</returns>
138+ [ DeltaLakeSince ( DeltaLakeVersions . V0_3_0 ) ]
134139 public static DeltaTable ForPath ( string path ) =>
135140 new DeltaTable (
136141 ( JvmObjectReference ) SparkEnvironment . JvmBridge . CallStaticJavaMethod (
@@ -145,6 +150,7 @@ public static DeltaTable ForPath(string path) =>
145150 /// <param name="sparkSession">The active SparkSession.</param>
146151 /// <param name="path">The path to the data.</param>
147152 /// <returns>DeltaTable loaded from the path.</returns>
153+ [ DeltaLakeSince ( DeltaLakeVersions . V0_3_0 ) ]
148154 public static DeltaTable ForPath ( SparkSession sparkSession , string path ) =>
149155 new DeltaTable (
150156 ( JvmObjectReference ) SparkEnvironment . JvmBridge . CallStaticJavaMethod (
@@ -165,6 +171,7 @@ public static DeltaTable ForPath(SparkSession sparkSession, string path) =>
165171 /// <param name="sparkSession">The relevant session.</param>
166172 /// <param name="identifier">String that identifies the table, e.g. path to table.</param>
167173 /// <returns>True if the table is a DeltaTable.</returns>
174+ [ DeltaLakeSince ( DeltaLakeVersions . V0_4_0 ) ]
168175 public static bool IsDeltaTable ( SparkSession sparkSession , string identifier ) =>
169176 ( bool ) SparkEnvironment . JvmBridge . CallStaticJavaMethod (
170177 s_deltaTableClassName ,
@@ -187,6 +194,7 @@ public static bool IsDeltaTable(SparkSession sparkSession, string identifier) =>
187194 /// </summary>
188195 /// <param name="identifier">String that identifies the table, e.g. path to table.</param>
189196 /// <returns>True if the table is a DeltaTable.</returns>
197+ [ DeltaLakeSince ( DeltaLakeVersions . V0_4_0 ) ]
190198 public static bool IsDeltaTable ( string identifier ) =>
191199 ( bool ) SparkEnvironment . JvmBridge . CallStaticJavaMethod (
192200 s_deltaTableClassName ,
@@ -199,6 +207,7 @@ public static bool IsDeltaTable(string identifier) =>
199207 /// </summary>
200208 /// <param name="alias">The table alias.</param>
201209 /// <returns>Aliased DeltaTable.</returns>
210+ [ DeltaLakeSince ( DeltaLakeVersions . V0_3_0 ) ]
202211 public DeltaTable As ( string alias ) =>
203212 new DeltaTable ( ( JvmObjectReference ) _jvmObject . Invoke ( "as" , alias ) ) ;
204213
@@ -208,13 +217,15 @@ public DeltaTable As(string alias) =>
208217 /// </summary>
209218 /// <param name="alias">The table alias.</param>
210219 /// <returns>Aliased DeltaTable.</returns>
220+ [ DeltaLakeSince ( DeltaLakeVersions . V0_3_0 ) ]
211221 public DeltaTable Alias ( string alias ) =>
212222 new DeltaTable ( ( JvmObjectReference ) _jvmObject . Invoke ( "alias" , alias ) ) ;
213223
214224 /// <summary>
215225 /// Get a DataFrame (that is, Dataset[Row]) representation of this Delta table.
216226 /// </summary>
217227 /// <returns>DataFrame representation of Delta table.</returns>
228+ [ DeltaLakeSince ( DeltaLakeVersions . V0_3_0 ) ]
218229 public DataFrame ToDF ( ) => new DataFrame ( ( JvmObjectReference ) _jvmObject . Invoke ( "toDF" ) ) ;
219230
220231 /// <summary>
@@ -226,6 +237,7 @@ public DeltaTable Alias(string alias) =>
226237 /// table for reading versions earlier than this will be preserved and the rest of them
227238 /// will be deleted.</param>
228239 /// <returns>Vacuumed DataFrame.</returns>
240+ [ DeltaLakeSince ( DeltaLakeVersions . V0_3_0 ) ]
229241 public DataFrame Vacuum ( double retentionHours ) =>
230242 new DataFrame ( ( JvmObjectReference ) _jvmObject . Invoke ( "vacuum" , retentionHours ) ) ;
231243
@@ -237,6 +249,7 @@ public DataFrame Vacuum(double retentionHours) =>
237249 /// Note: This will use the default retention period of 7 days.
238250 /// </summary>
239251 /// <returns>Vacuumed DataFrame.</returns>
252+ [ DeltaLakeSince ( DeltaLakeVersions . V0_3_0 ) ]
240253 public DataFrame Vacuum ( ) =>
241254 new DataFrame ( ( JvmObjectReference ) _jvmObject . Invoke ( "vacuum" ) ) ;
242255
@@ -246,6 +259,7 @@ public DataFrame Vacuum() =>
246259 /// </summary>
247260 /// <param name="limit">The number of previous commands to get history for.</param>
248261 /// <returns>History DataFrame.</returns>
262+ [ DeltaLakeSince ( DeltaLakeVersions . V0_3_0 ) ]
249263 public DataFrame History ( int limit ) =>
250264 new DataFrame ( ( JvmObjectReference ) _jvmObject . Invoke ( "history" , limit ) ) ;
251265
@@ -254,6 +268,7 @@ public DataFrame History(int limit) =>
254268 /// information is in reverse chronological order.
255269 /// </summary>
256270 /// <returns>History DataFrame</returns>
271+ [ DeltaLakeSince ( DeltaLakeVersions . V0_3_0 ) ]
257272 public DataFrame History ( ) =>
258273 new DataFrame ( ( JvmObjectReference ) _jvmObject . Invoke ( "history" ) ) ;
259274
@@ -265,23 +280,27 @@ public DataFrame History() =>
265280 /// - "symlink_format_manifest" : This will generate manifests in symlink format
266281 /// for Presto and Athena read support.
267282 /// See the online documentation for more information.</param>
283+ [ DeltaLakeSince ( DeltaLakeVersions . V0_5_0 ) ]
268284 public void Generate ( string mode ) => _jvmObject . Invoke ( "generate" , mode ) ;
269285
270286 /// <summary>
271287 /// Delete data from the table that match the given <c>condition</c>.
272288 /// </summary>
273289 /// <param name="condition">Boolean SQL expression.</param>
290+ [ DeltaLakeSince ( DeltaLakeVersions . V0_3_0 ) ]
274291 public void Delete ( string condition ) => _jvmObject . Invoke ( "delete" , condition ) ;
275292
276293 /// <summary>
277294 /// Delete data from the table that match the given <c>condition</c>.
278295 /// </summary>
279296 /// <param name="condition">Boolean SQL expression.</param>
297+ [ DeltaLakeSince ( DeltaLakeVersions . V0_3_0 ) ]
280298 public void Delete ( Column condition ) => _jvmObject . Invoke ( "delete" , condition ) ;
281299
282300 /// <summary>
283301 /// Delete data from the table.
284302 /// </summary>
303+ [ DeltaLakeSince ( DeltaLakeVersions . V0_3_0 ) ]
285304 public void Delete ( ) => _jvmObject . Invoke ( "delete" ) ;
286305
287306 /// <summary>
@@ -297,6 +316,7 @@ public DataFrame History() =>
297316 /// </example>
298317 /// <param name="set">Pules to update a row as a Scala map between target column names
299318 /// and corresponding update expressions as Column objects.</param>
319+ [ DeltaLakeSince ( DeltaLakeVersions . V0_3_0 ) ]
300320 public void Update ( Dictionary < string , Column > set ) => _jvmObject . Invoke ( "update" , set ) ;
301321
302322 /// <summary>
@@ -317,6 +337,7 @@ public DataFrame History() =>
317337 /// to update.</param>
318338 /// <param name="set">Rules to update a row as a Scala map between target column names and
319339 /// corresponding update expressions as Column objects.</param>
340+ [ DeltaLakeSince ( DeltaLakeVersions . V0_3_0 ) ]
320341 public void Update ( Column condition , Dictionary < string , Column > set ) =>
321342 _jvmObject . Invoke ( "update" , condition , set ) ;
322343
@@ -334,6 +355,7 @@ public void Update(Column condition, Dictionary<string, Column> set) =>
334355 /// </example>
335356 /// <param name="set">Rules to update a row as a Scala map between target column names and
336357 /// corresponding update expressions as SQL formatted strings.</param>
358+ [ DeltaLakeSince ( DeltaLakeVersions . V0_3_0 ) ]
337359 public void UpdateExpr ( Dictionary < string , string > set ) =>
338360 _jvmObject . Invoke ( "updateExpr" , set ) ;
339361
@@ -355,6 +377,7 @@ public void UpdateExpr(Dictionary<string, string> set) =>
355377 /// which rows to update.</param>
356378 /// <param name="set">Rules to update a row as a map between target column names and
357379 /// corresponding update expressions as SQL formatted strings.</param>
380+ [ DeltaLakeSince ( DeltaLakeVersions . V0_3_0 ) ]
358381 public void UpdateExpr ( string condition , Dictionary < string , string > set ) =>
359382 _jvmObject . Invoke ( "updateExpr" , condition , set ) ;
360383
@@ -395,6 +418,7 @@ public void UpdateExpr(string condition, Dictionary<string, string> set) =>
395418 /// <param name="source">Source Dataframe to be merged.</param>
396419 /// <param name="condition">Boolean expression as SQL formatted string.</param>
397420 /// <returns>DeltaMergeBuilder</returns>
421+ [ DeltaLakeSince ( DeltaLakeVersions . V0_3_0 ) ]
398422 public DeltaMergeBuilder Merge ( DataFrame source , string condition ) =>
399423 new DeltaMergeBuilder (
400424 ( JvmObjectReference ) _jvmObject . Invoke (
@@ -436,6 +460,7 @@ public DeltaMergeBuilder Merge(DataFrame source, string condition) =>
436460 /// <param name="source">Source Dataframe to be merged.</param>
437461 /// <param name="condition">Coolean expression as a Column object</param>
438462 /// <returns>DeltaMergeBuilder</returns>
463+ [ DeltaLakeSince ( DeltaLakeVersions . V0_3_0 ) ]
439464 public DeltaMergeBuilder Merge ( DataFrame source , Column condition ) =>
440465 new DeltaMergeBuilder (
441466 ( JvmObjectReference ) _jvmObject . Invoke (
0 commit comments