Github user rdblue commented on a diff in the pull request:

    https://github.com/apache/spark/pull/23086#discussion_r237668483
  
    --- Diff: sql/core/src/main/java/org/apache/spark/sql/sources/v2/Table.java 
---
    @@ -0,0 +1,65 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark.sql.sources.v2;
    +
    +import org.apache.spark.annotation.Evolving;
    +import org.apache.spark.sql.sources.v2.reader.Scan;
    +import org.apache.spark.sql.sources.v2.reader.ScanBuilder;
    +import org.apache.spark.sql.types.StructType;
    +
    +/**
    + * An interface representing a logical structured data set of a data 
source. For example, the
    + * implementation can be a directory on the file system, a topic of Kafka, 
or a table in the
    + * catalog, etc.
    + * <p>
    + * This interface can mixin the following interfaces to support different 
operations:
    + * </p>
    + * <ul>
    + *   <li>{@link SupportsBatchRead}: this table can be read in batch 
queries.</li>
    + * </ul>
    + */
    +@Evolving
    +public interface Table {
    +
    +  /**
    +   * A name to identify this table.
    +   * <p>
    +   * By default this returns the class name of this 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>
    +   */
    +  default String name() {
    --- End diff --
    
    I don't think this should have a default. Implementations should definitely 
implement this.
    
    I think there is a difference between `toString` and `name`. An 
implementation may choose to display `name` when showing a table's string 
representation, but may choose to include extra information to show more about 
the table state, like Iceberg's snapshot ID.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to