Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-10104][SQL] Consolidate different forms of table identifiers #8453

Closed
wants to merge 5 commits into from

Conversation

cloud-fan
Copy link
Contributor

Right now, we have QualifiedTableName, TableIdentifier, and Seq[String] to represent table identifiers. We should only have one form and TableIdentifier is the best one because it provides methods to get table name, database name, return unquoted string, and return quoted string.

@SparkQA
Copy link

SparkQA commented Aug 26, 2015

Test build #41604 has finished for PR 8453 at commit 17b7406.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • class LogisticRegressionModel @Since("1.3.0") (
    • class SVMModel @Since("1.1.0") (
    • class BinaryClassificationMetrics @Since("1.3.0") (
    • class MulticlassMetrics @Since("1.1.0") (predictionAndLabels: RDD[(Double, Double)])
    • class MultilabelMetrics @Since("1.2.0") (predictionAndLabels: RDD[(Array[Double], Array[Double])])
    • class RegressionMetrics @Since("1.2.0") (
    • class FPGrowthModel[Item: ClassTag] @Since("1.3.0") (
    • class FreqItemset[Item] @Since("1.3.0") (
    • class FreqSequence[Item] @Since("1.5.0") (
    • class PrefixSpanModel[Item] @Since("1.5.0") (
    • class DenseMatrix @Since("1.3.0") (
    • class SparseMatrix @Since("1.3.0") (
    • class DenseVector @Since("1.0.0") (
    • class SparseVector @Since("1.0.0") (
    • class BlockMatrix @Since("1.3.0") (
    • class CoordinateMatrix @Since("1.0.0") (
    • class IndexedRowMatrix @Since("1.0.0") (
    • class RowMatrix @Since("1.0.0") (
    • abstract class SetOperation(left: LogicalPlan, right: LogicalPlan) extends BinaryNode
    • case class Union(left: LogicalPlan, right: LogicalPlan) extends SetOperation(left, right)
    • case class Intersect(left: LogicalPlan, right: LogicalPlan) extends SetOperation(left, right)
    • case class Except(left: LogicalPlan, right: LogicalPlan) extends SetOperation(left, right)
    • case class QualifiedTableName(database: String, name: String)

@SparkQA
Copy link

SparkQA commented Aug 26, 2015

Test build #41605 has finished for PR 8453 at commit e8d88e9.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • case class QualifiedTableName(database: String, name: String)

@cloud-fan cloud-fan force-pushed the table-name branch 2 times, most recently from de2736f to 63f2f07 Compare August 26, 2015 07:37
@SparkQA
Copy link

SparkQA commented Aug 26, 2015

Test build #41607 has finished for PR 8453 at commit 9f8b314.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • case class QualifiedTableName(database: String, name: String)

@SparkQA
Copy link

SparkQA commented Aug 26, 2015

Test build #41608 has finished for PR 8453 at commit de2736f.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • case class QualifiedTableName(database: String, name: String)

@SparkQA
Copy link

SparkQA commented Aug 26, 2015

Test build #41610 has finished for PR 8453 at commit 63f2f07.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • case class QualifiedTableName(database: String, name: String)

@SparkQA
Copy link

SparkQA commented Aug 26, 2015

Test build #41612 has finished for PR 8453 at commit 9051701.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • case class QualifiedTableName(database: String, name: String)

@SparkQA
Copy link

SparkQA commented Aug 26, 2015

Test build #41617 has finished for PR 8453 at commit 1692b53.

  • This patch fails SparkR unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • case class QualifiedTableName(database: String, name: String)

@SparkQA
Copy link

SparkQA commented Aug 26, 2015

Test build #41622 has finished for PR 8453 at commit 49b8d3d.

  • This patch fails SparkR unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • case class QualifiedTableName(database: String, name: String)

@cloud-fan
Copy link
Contributor Author

cc @yhuai

@SparkQA
Copy link

SparkQA commented Aug 26, 2015

Test build #41631 has finished for PR 8453 at commit fbd03df.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • case class QualifiedTableName(database: String, name: String)

@yhuai
Copy link
Contributor

yhuai commented Aug 27, 2015

@cloud-fan Thank you for working on it. Since we are pretty close to 1.5 release, let's wait until the release and get this merged at the beginning of 1.6 release cycle.

@SparkQA
Copy link

SparkQA commented Oct 3, 2015

Test build #43207 has finished for PR 8453 at commit 3be0e4b.

  • This patch fails Scala style tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • class SimpleCatalog(val conf: CatalystConf) extends Catalog
    • trait ExtendedCatalog extends SimpleCatalog

@cloud-fan
Copy link
Contributor Author

retest this please.

@SparkQA
Copy link

SparkQA commented Oct 3, 2015

Test build #43208 has finished for PR 8453 at commit 9bc2db1.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • class SimpleCatalog(val conf: CatalystConf) extends Catalog
    • trait ExtendedCatalog extends SimpleCatalog

@SparkQA
Copy link

SparkQA commented Oct 3, 2015

Test build #43209 has finished for PR 8453 at commit 9bc2db1.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • class SimpleCatalog(val conf: CatalystConf) extends Catalog
    • trait ExtendedCatalog extends SimpleCatalog

@cloud-fan cloud-fan force-pushed the table-name branch 2 times, most recently from b73a696 to 71a7d54 Compare October 3, 2015 20:39
@SparkQA
Copy link

SparkQA commented Oct 3, 2015

Test build #43219 has finished for PR 8453 at commit 71a7d54.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • final class ChiSqSelector(override val uid: String)
    • final class QuantileDiscretizer(override val uid: String)
    • class SimpleCatalog(val conf: CatalystConf) extends Catalog
    • trait ExtendedCatalog extends SimpleCatalog


def toSeq: Seq[String] = database.toSeq :+ table
def quotedString: String = database.map(db => s"`$db`.`$table`").getOrElse(s"`$table`")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$db may already have . in it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the same behaviour of the original implementation def quotedString: String = toSeq.map("" + _ + "``").mkString(".")`.

@cloud-fan
Copy link
Contributor Author

retest this please.

@SparkQA
Copy link

SparkQA commented Oct 12, 2015

Test build #43594 has finished for PR 8453 at commit 71a7d54.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • class SimpleCatalog(val conf: CatalystConf) extends Catalog
    • trait ExtendedCatalog extends SimpleCatalog

@SparkQA
Copy link

SparkQA commented Oct 13, 2015

Test build #43601 has finished for PR 8453 at commit 71a7d54.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • class SimpleCatalog(val conf: CatalystConf) extends Catalog
    • trait ExtendedCatalog extends SimpleCatalog

@SparkQA
Copy link

SparkQA commented Oct 13, 2015

Test build #43605 has finished for PR 8453 at commit 1d89c37.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • class SimpleCatalog(val conf: CatalystConf) extends Catalog
    • trait ExtendedCatalog extends SimpleCatalog

@SparkQA
Copy link

SparkQA commented Oct 13, 2015

Test build #43613 has finished for PR 8453 at commit 26ee534.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • class SimpleCatalog(val conf: CatalystConf) extends Catalog
    • trait ExtendedCatalog extends SimpleCatalog
    • case class QualifiedTableName(database: String, name: String)

@SparkQA
Copy link

SparkQA commented Oct 13, 2015

Test build #43627 has finished for PR 8453 at commit 2714fc0.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • class SimpleCatalog(val conf: CatalystConf) extends Catalog
    • trait ExtendedCatalog extends SimpleCatalog
    • case class QualifiedTableName(database: String, name: String)

def withDatabase(database: String): TableIdentifier = this.copy(database = Some(database))
private[sql] case class TableIdentifier(table: String, database: Option[String]) {
override def toString: String = {
if (table.contains('.') || database.exists(_.contains('.'))) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SparkQA
Copy link

SparkQA commented Oct 13, 2015

Test build #43659 has finished for PR 8453 at commit 8dde0d9.

  • This patch fails Scala style tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • case class QualifiedTableName(database: String, name: String)

@SparkQA
Copy link

SparkQA commented Oct 13, 2015

Test build #43661 has finished for PR 8453 at commit b6a1f97.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • case class QualifiedTableName(database: String, name: String)


def toSeq: Seq[String] = database.toSeq :+ table
override def toString: String = {
if (table.contains('.') || database.exists(_.contains('.'))) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some other character that need quote.

@SparkQA
Copy link

SparkQA commented Oct 14, 2015

Test build #43681 has finished for PR 8453 at commit b60ee53.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • case class QualifiedTableName(database: String, name: String)

@SparkQA
Copy link

SparkQA commented Oct 14, 2015

Test build #43725 has finished for PR 8453 at commit 6ad40d1.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • def getPath = path.getOrElse(sys.error("Constructors must start at a class type"))
    • case class ExprId(id: Long, jvmId: UUID)
    • case class WrapOption(optionType: DataType, child: Expression)
    • class GenericArrayData(val array: Array[Any]) extends ArrayData
    • trait QueryExecutionListener
    • class ExecutionListenerManager extends Logging
    • case class QualifiedTableName(database: String, name: String)

@SparkQA
Copy link

SparkQA commented Oct 14, 2015

Test build #43733 has finished for PR 8453 at commit 5cfb8cc.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • def getPath = path.getOrElse(sys.error("Constructors must start at a class type"))
    • case class WrapOption(optionType: DataType, child: Expression)
    • class GenericArrayData(val array: Array[Any]) extends ArrayData
    • trait QueryExecutionListener
    • class ExecutionListenerManager extends Logging
    • case class QualifiedTableName(database: String, name: String)

@SparkQA
Copy link

SparkQA commented Oct 14, 2015

Test build #43735 has finished for PR 8453 at commit 230970c.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • def getPath = path.getOrElse(sys.error("Constructors must start at a class type"))
    • case class WrapOption(optionType: DataType, child: Expression)
    • class GenericArrayData(val array: Array[Any]) extends ArrayData
    • trait QueryExecutionListener
    • class ExecutionListenerManager extends Logging
    • case class QualifiedTableName(database: String, name: String)

@davies
Copy link
Contributor

davies commented Oct 14, 2015

LGTM, merging this into master.

@asfgit asfgit closed this in 56d7da1 Oct 14, 2015
@cloud-fan cloud-fan deleted the table-name branch October 14, 2015 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants