Skip to content

Commit

Permalink
applied
Browse files Browse the repository at this point in the history
  • Loading branch information
scottsand-db committed Aug 2, 2024
1 parent f83bd35 commit b90d360
Show file tree
Hide file tree
Showing 214 changed files with 21,003 additions and 22,074 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,39 +15,38 @@
*/
package io.delta.kernel;

import java.util.List;
import java.util.Map;

import io.delta.kernel.annotation.Evolving;
import io.delta.kernel.data.Row;
import io.delta.kernel.engine.Engine;
import io.delta.kernel.expressions.Column;
import java.util.List;
import java.util.Map;

/**
* Contains the context for writing data to Delta table. The context is created for each partition
* for partitioned table or once per table for un-partitioned table. It is created using
* {@link Transaction#getWriteContext(Engine, Row, Map)} (String, Map, List)}.
* for partitioned table or once per table for un-partitioned table. It is created using {@link
* Transaction#getWriteContext(Engine, Row, Map)} (String, Map, List)}.
*
* @since 3.2.0
*/
@Evolving
public interface DataWriteContext {
/**
* Returns the target directory where the data should be written.
*
* @return fully qualified path of the target directory
*/
String getTargetDirectory();
/**
* Returns the target directory where the data should be written.
*
* @return fully qualified path of the target directory
*/
String getTargetDirectory();

/**
* Returns the list of {@link Column} that the connector can optionally collect statistics. Each
* {@link Column} is a reference to a top-level or nested column in the table.
* <p>
* Statistics collections can be skipped or collected for a partial list of the returned
* {@link Column}s. When stats are present in the written Delta log, they can be used to
* optimize query performance.
*
* @return schema of the statistics
*/
List<Column> getStatisticsColumns();
/**
* Returns the list of {@link Column} that the connector can optionally collect statistics. Each
* {@link Column} is a reference to a top-level or nested column in the table.
*
* <p>Statistics collections can be skipped or collected for a partial list of the returned {@link
* Column}s. When stats are present in the written Delta log, they can be used to optimize query
* performance.
*
* @return schema of the statistics
*/
List<Column> getStatisticsColumns();
}
64 changes: 26 additions & 38 deletions kernel/kernel-api/src/main/java/io/delta/kernel/Operation.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,45 +17,33 @@

/**
* An operation that can be performed on a Delta table.
* <p>
* An operation is tracked as the first line in commit info action inside the Delta Log
* It also shows up when {@code DESCRIBE HISTORY} on the table is executed.
*
* <p>An operation is tracked as the first line in commit info action inside the Delta Log It also
* shows up when {@code DESCRIBE HISTORY} on the table is executed.
*/
public enum Operation {

/**
* Recorded when the table is created.
*/
CREATE_TABLE("CREATE TABLE"),

/**
* Recorded during batch inserts.
*/
WRITE("WRITE"),

/**
* Recorded during streaming inserts.
*/
STREAMING_UPDATE("STREAMING UPDATE"),

/**
* For any operation that doesn't fit the above categories.
*/
MANUAL_UPDATE("Manual Update");

/**
* Actual value that will be recorded in the transaction log
*/
private final String description;

Operation(String description) {
this.description = description;
}

/**
* Returns the string that will be recorded in the transaction log.
*/
public String getDescription() {
return description;
}
/** Recorded when the table is created. */
CREATE_TABLE("CREATE TABLE"),

/** Recorded during batch inserts. */
WRITE("WRITE"),

/** Recorded during streaming inserts. */
STREAMING_UPDATE("STREAMING UPDATE"),

/** For any operation that doesn't fit the above categories. */
MANUAL_UPDATE("Manual Update");

/** Actual value that will be recorded in the transaction log */
private final String description;

Operation(String description) {
this.description = description;
}

/** Returns the string that will be recorded in the transaction log. */
public String getDescription() {
return description;
}
}
Loading

0 comments on commit b90d360

Please sign in to comment.