Skip to content

Commit

Permalink
remove default implementation of Table.name
Browse files Browse the repository at this point in the history
  • Loading branch information
cloud-fan committed Nov 30, 2018
1 parent 811481a commit eecb161
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,10 @@
public interface Table {

/**
* A name to identify this table.
* <p>
* By default this returns the class name of the implementation. Please override it to provide a
* meaningful name, like the database and table name from catalog, or the location of files for
* this table.
* </p>
* A name to identify this table. Implementations should provide a meaningful name, like the
* database and table name from catalog, or the location of files for this table.
*/
default String name() {
return this.getClass().toString();
}
String name();

/**
* Returns the schema of this table.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ abstract class JavaSimpleBatchTable implements Table, SupportsBatchRead {
public StructType schema() {
return new StructType().add("i", "int").add("j", "int");
}

@Override
public String name() {
return this.getClass().toString();
}
}

abstract class JavaSimpleScanBuilder implements ScanBuilder, Scan, Batch {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,8 @@ object SimpleReaderFactory extends PartitionReaderFactory {
abstract class SimpleBatchTable extends Table with SupportsBatchRead {

override def schema(): StructType = new StructType().add("i", "int").add("j", "int")

override def name(): String = this.getClass.toString
}

abstract class SimpleScanBuilder extends ScanBuilder
Expand Down

0 comments on commit eecb161

Please sign in to comment.