Packages

c

org.apache.spark.sql.execution.command

CreateTableLikeCommand

case class CreateTableLikeCommand(targetTable: TableIdentifier, sourceTable: TableIdentifier, fileFormat: CatalogStorageFormat, provider: Option[String], properties: Map[String, String] = Map.empty, ifNotExists: Boolean) extends LogicalPlan with LeafRunnableCommand with Product with Serializable

A command to create a table with the same definition of the given existing table. In the target table definition, the table comment is always empty but the column comments are identical to the ones defined in the source table.

The CatalogTable attributes copied from the source table are storage(inputFormat, outputFormat, serde, compressed, properties), schema, provider, partitionColumnNames, bucketSpec by default.

Use "CREATE TABLE t1 LIKE t2 USING file_format" to specify new provider for t1. For Hive compatibility, use "CREATE TABLE t1 LIKE t2 STORED AS hiveFormat" to specify new file storage format (inputFormat, outputFormat, serde) for t1.

The syntax of using this command in SQL is:

CREATE TABLE [IF NOT EXISTS] [db_name.]table_name
LIKE [other_db_name.]existing_table_name
[USING provider |
 [
  [ROW FORMAT row_format]
  [STORED AS file_format] [WITH SERDEPROPERTIES (...)]
 ]
]
[locationSpec]
[TBLPROPERTIES (property_name=property_value, ...)]
Linear Supertypes
Serializable, LeafRunnableCommand, LeafLike[LogicalPlan], RunnableCommand, Command, LogicalPlan, Logging, QueryPlanConstraints, ConstraintHelper, LogicalPlanDistinctKeys, LogicalPlanStats, AnalysisHelper, QueryPlan[LogicalPlan], SQLConfHelper, TreeNode[LogicalPlan], WithOrigin, TreePatternBits, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. CreateTableLikeCommand
  2. Serializable
  3. LeafRunnableCommand
  4. LeafLike
  5. RunnableCommand
  6. Command
  7. LogicalPlan
  8. Logging
  9. QueryPlanConstraints
  10. ConstraintHelper
  11. LogicalPlanDistinctKeys
  12. LogicalPlanStats
  13. AnalysisHelper
  14. QueryPlan
  15. SQLConfHelper
  16. TreeNode
  17. WithOrigin
  18. TreePatternBits
  19. Product
  20. Equals
  21. AnyRef
  22. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new CreateTableLikeCommand(targetTable: TableIdentifier, sourceTable: TableIdentifier, fileFormat: CatalogStorageFormat, provider: Option[String], properties: Map[String, String] = Map.empty, ifNotExists: Boolean)

Value Members

  1. lazy val allAttributes: AttributeSeq
    Definition Classes
    QueryPlan
  2. def analyzed: Boolean
    Definition Classes
    AnalysisHelper
  3. def apply(number: Int): TreeNode[_]
    Definition Classes
    TreeNode
  4. def argString(maxFields: Int): String
    Definition Classes
    TreeNode
  5. def asCode: String
    Definition Classes
    TreeNode
  6. final lazy val canonicalized: LogicalPlan
    Definition Classes
    QueryPlan
    Annotations
    @transient()
  7. final def children: Seq[LogicalPlan]
    Definition Classes
    LeafLike
  8. def childrenResolved: Boolean
    Definition Classes
    LogicalPlan
  9. def clone(): LogicalPlan
    Definition Classes
    AnalysisHelper → TreeNode → AnyRef
  10. def collect[B](pf: PartialFunction[LogicalPlan, B]): Seq[B]
    Definition Classes
    TreeNode
  11. def collectFirst[B](pf: PartialFunction[LogicalPlan, B]): Option[B]
    Definition Classes
    TreeNode
  12. def collectLeaves(): Seq[LogicalPlan]
    Definition Classes
    TreeNode
  13. def collectWithSubqueries[B](f: PartialFunction[LogicalPlan, B]): Seq[B]
    Definition Classes
    QueryPlan
  14. def conf: SQLConf
    Definition Classes
    SQLConfHelper
  15. lazy val constraints: ExpressionSet
    Definition Classes
    QueryPlanConstraints
  16. def constructIsNotNullConstraints(constraints: ExpressionSet, output: Seq[Attribute]): ExpressionSet
    Definition Classes
    ConstraintHelper
  17. final def containsAllPatterns(patterns: TreePattern*): Boolean
    Definition Classes
    TreePatternBits
  18. final def containsAnyPattern(patterns: TreePattern*): Boolean
    Definition Classes
    TreePatternBits
  19. lazy val containsChild: Set[TreeNode[_]]
    Definition Classes
    TreeNode
  20. final def containsPattern(t: TreePattern): Boolean
    Definition Classes
    TreePatternBits
    Annotations
    @inline()
  21. def copyTagsFrom(other: LogicalPlan): Unit
    Definition Classes
    TreeNode
  22. lazy val deterministic: Boolean
    Definition Classes
    QueryPlan
  23. lazy val distinctKeys: Set[ExpressionSet]
    Definition Classes
    LogicalPlanDistinctKeys
  24. def exists(f: (LogicalPlan) => Boolean): Boolean
    Definition Classes
    TreeNode
  25. final def expressions: Seq[Expression]
    Definition Classes
    QueryPlan
  26. def fastEquals(other: TreeNode[_]): Boolean
    Definition Classes
    TreeNode
  27. val fileFormat: CatalogStorageFormat
  28. def find(f: (LogicalPlan) => Boolean): Option[LogicalPlan]
    Definition Classes
    TreeNode
  29. def flatMap[A](f: (LogicalPlan) => TraversableOnce[A]): Seq[A]
    Definition Classes
    TreeNode
  30. def foreach(f: (LogicalPlan) => Unit): Unit
    Definition Classes
    TreeNode
  31. def foreachUp(f: (LogicalPlan) => Unit): Unit
    Definition Classes
    TreeNode
  32. def generateTreeString(depth: Int, lastChildren: ArrayList[Boolean], append: (String) => Unit, verbose: Boolean, prefix: String, addSuffix: Boolean, maxFields: Int, printNodeId: Boolean, indent: Int): Unit
    Definition Classes
    TreeNode
  33. def getMetadataAttributeByName(name: String): AttributeReference
    Definition Classes
    LogicalPlan
  34. def getMetadataAttributeByNameOpt(name: String): Option[AttributeReference]
    Definition Classes
    LogicalPlan
  35. def getTagValue[T](tag: TreeNodeTag[T]): Option[T]
    Definition Classes
    TreeNode
  36. def hashCode(): Int
    Definition Classes
    TreeNode → AnyRef → Any
  37. val ifNotExists: Boolean
  38. def inferAdditionalConstraints(constraints: ExpressionSet): ExpressionSet
    Definition Classes
    ConstraintHelper
  39. def innerChildren: Seq[QueryPlan[_]]
    Definition Classes
    QueryPlan → TreeNode
  40. def inputSet: AttributeSet
    Definition Classes
    QueryPlan
  41. final def invalidateStatsCache(): Unit
    Definition Classes
    LogicalPlanStats
  42. def isStreaming: Boolean
    Definition Classes
    LogicalPlan
  43. def makeCopy(newArgs: Array[AnyRef]): LogicalPlan
    Definition Classes
    TreeNode
  44. def map[A](f: (LogicalPlan) => A): Seq[A]
    Definition Classes
    TreeNode
  45. final def mapChildren(f: (LogicalPlan) => LogicalPlan): LogicalPlan
    Definition Classes
    LeafLike
  46. def mapExpressions(f: (Expression) => Expression): CreateTableLikeCommand.this.type
    Definition Classes
    QueryPlan
  47. def maxRows: Option[Long]
    Definition Classes
    LogicalPlan
  48. def maxRowsPerPartition: Option[Long]
    Definition Classes
    LogicalPlan
  49. def metadataOutput: Seq[Attribute]
    Definition Classes
    LogicalPlan
  50. lazy val metrics: Map[String, SQLMetric]
    Definition Classes
    RunnableCommand
  51. final def missingInput: AttributeSet
    Definition Classes
    QueryPlan
  52. def multiTransformDown(rule: PartialFunction[LogicalPlan, Seq[LogicalPlan]]): Stream[LogicalPlan]
    Definition Classes
    TreeNode
  53. def multiTransformDownWithPruning(cond: (TreePatternBits) => Boolean, ruleId: RuleId)(rule: PartialFunction[LogicalPlan, Seq[LogicalPlan]]): Stream[LogicalPlan]
    Definition Classes
    TreeNode
  54. def nodeName: String
    Definition Classes
    TreeNode
  55. final val nodePatterns: Seq[TreePattern]
    Definition Classes
    Command → TreeNode
  56. def numberedTreeString: String
    Definition Classes
    TreeNode
  57. val origin: Origin
    Definition Classes
    TreeNode → WithOrigin
  58. def output: Seq[Attribute]
    Definition Classes
    Command → QueryPlan
  59. def outputOrdering: Seq[SortOrder]
    Definition Classes
    QueryPlan
  60. lazy val outputSet: AttributeSet
    Definition Classes
    QueryPlan
    Annotations
    @transient()
  61. def p(number: Int): LogicalPlan
    Definition Classes
    TreeNode
  62. def prettyJson: String
    Definition Classes
    TreeNode
  63. def printSchema(): Unit
    Definition Classes
    QueryPlan
  64. def producedAttributes: AttributeSet
    Definition Classes
    Command → QueryPlan
  65. def productElementNames: Iterator[String]
    Definition Classes
    Product
  66. val properties: Map[String, String]
  67. val provider: Option[String]
  68. lazy val references: AttributeSet
    Definition Classes
    QueryPlan
    Annotations
    @transient()
  69. def refresh(): Unit
    Definition Classes
    LogicalPlan
  70. def resolve(nameParts: Seq[String], resolver: Resolver): Option[NamedExpression]
    Definition Classes
    LogicalPlan
  71. def resolve(schema: StructType, resolver: Resolver): Seq[Attribute]
    Definition Classes
    LogicalPlan
  72. def resolveChildren(nameParts: Seq[String], resolver: Resolver): Option[NamedExpression]
    Definition Classes
    LogicalPlan
  73. def resolveExpressions(r: PartialFunction[Expression, Expression]): LogicalPlan
    Definition Classes
    AnalysisHelper
  74. def resolveExpressionsWithPruning(cond: (TreePatternBits) => Boolean, ruleId: RuleId)(rule: PartialFunction[Expression, Expression]): LogicalPlan
    Definition Classes
    AnalysisHelper
  75. def resolveOperators(rule: PartialFunction[LogicalPlan, LogicalPlan]): LogicalPlan
    Definition Classes
    AnalysisHelper
  76. def resolveOperatorsDown(rule: PartialFunction[LogicalPlan, LogicalPlan]): LogicalPlan
    Definition Classes
    AnalysisHelper
  77. def resolveOperatorsDownWithPruning(cond: (TreePatternBits) => Boolean, ruleId: RuleId)(rule: PartialFunction[LogicalPlan, LogicalPlan]): LogicalPlan
    Definition Classes
    AnalysisHelper
  78. def resolveOperatorsUp(rule: PartialFunction[LogicalPlan, LogicalPlan]): LogicalPlan
    Definition Classes
    AnalysisHelper
  79. def resolveOperatorsUpWithNewOutput(rule: PartialFunction[LogicalPlan, (LogicalPlan, Seq[(Attribute, Attribute)])]): LogicalPlan
    Definition Classes
    AnalysisHelper
  80. def resolveOperatorsUpWithPruning(cond: (TreePatternBits) => Boolean, ruleId: RuleId)(rule: PartialFunction[LogicalPlan, LogicalPlan]): LogicalPlan
    Definition Classes
    AnalysisHelper
  81. def resolveOperatorsWithPruning(cond: (TreePatternBits) => Boolean, ruleId: RuleId)(rule: PartialFunction[LogicalPlan, LogicalPlan]): LogicalPlan
    Definition Classes
    AnalysisHelper
  82. def resolveQuoted(name: String, resolver: Resolver): Option[NamedExpression]
    Definition Classes
    LogicalPlan
  83. lazy val resolved: Boolean
    Definition Classes
    LogicalPlan
  84. def rewriteAttrs(attrMap: AttributeMap[Attribute]): LogicalPlan
    Definition Classes
    QueryPlan
  85. def run(sparkSession: SparkSession): Seq[Row]
  86. def sameOutput(other: LogicalPlan): Boolean
    Definition Classes
    LogicalPlan
  87. final def sameResult(other: LogicalPlan): Boolean
    Definition Classes
    QueryPlan
  88. lazy val schema: StructType
    Definition Classes
    QueryPlan
  89. def schemaString: String
    Definition Classes
    QueryPlan
  90. final def semanticHash(): Int
    Definition Classes
    QueryPlan
  91. def setTagValue[T](tag: TreeNodeTag[T], value: T): Unit
    Definition Classes
    TreeNode
  92. def simpleString(maxFields: Int): String
    Definition Classes
    QueryPlan → TreeNode
  93. def simpleStringWithNodeId(): String
    Definition Classes
    QueryPlan → TreeNode
  94. val sourceTable: TableIdentifier
  95. def stats: Statistics
    Definition Classes
    Command → LogicalPlanStats
  96. lazy val subqueries: Seq[LogicalPlan]
    Definition Classes
    QueryPlan
    Annotations
    @transient()
  97. def subqueriesAll: Seq[LogicalPlan]
    Definition Classes
    QueryPlan
  98. val targetTable: TableIdentifier
  99. def toJSON: String
    Definition Classes
    TreeNode
  100. def toString(): String
    Definition Classes
    TreeNode → AnyRef → Any
  101. def transform(rule: PartialFunction[LogicalPlan, LogicalPlan]): LogicalPlan
    Definition Classes
    TreeNode
  102. def transformAllExpressions(rule: PartialFunction[Expression, Expression]): CreateTableLikeCommand.this.type
    Definition Classes
    QueryPlan
  103. def transformAllExpressionsWithPruning(cond: (TreePatternBits) => Boolean, ruleId: RuleId)(rule: PartialFunction[Expression, Expression]): CreateTableLikeCommand.this.type
    Definition Classes
    AnalysisHelper → QueryPlan
  104. def transformAllExpressionsWithSubqueries(rule: PartialFunction[Expression, Expression]): CreateTableLikeCommand.this.type
    Definition Classes
    QueryPlan
  105. def transformDown(rule: PartialFunction[LogicalPlan, LogicalPlan]): LogicalPlan
    Definition Classes
    TreeNode
  106. def transformDownWithPruning(cond: (TreePatternBits) => Boolean, ruleId: RuleId)(rule: PartialFunction[LogicalPlan, LogicalPlan]): LogicalPlan
    Definition Classes
    AnalysisHelper → TreeNode
  107. def transformDownWithSubqueries(f: PartialFunction[LogicalPlan, LogicalPlan]): LogicalPlan
    Definition Classes
    QueryPlan
  108. def transformDownWithSubqueriesAndPruning(cond: (TreePatternBits) => Boolean, ruleId: RuleId)(f: PartialFunction[LogicalPlan, LogicalPlan]): LogicalPlan
    Definition Classes
    QueryPlan
  109. def transformExpressions(rule: PartialFunction[Expression, Expression]): CreateTableLikeCommand.this.type
    Definition Classes
    QueryPlan
  110. def transformExpressionsDown(rule: PartialFunction[Expression, Expression]): CreateTableLikeCommand.this.type
    Definition Classes
    QueryPlan
  111. def transformExpressionsDownWithPruning(cond: (TreePatternBits) => Boolean, ruleId: RuleId)(rule: PartialFunction[Expression, Expression]): CreateTableLikeCommand.this.type
    Definition Classes
    QueryPlan
  112. def transformExpressionsUp(rule: PartialFunction[Expression, Expression]): CreateTableLikeCommand.this.type
    Definition Classes
    QueryPlan
  113. def transformExpressionsUpWithPruning(cond: (TreePatternBits) => Boolean, ruleId: RuleId)(rule: PartialFunction[Expression, Expression]): CreateTableLikeCommand.this.type
    Definition Classes
    QueryPlan
  114. def transformExpressionsWithPruning(cond: (TreePatternBits) => Boolean, ruleId: RuleId)(rule: PartialFunction[Expression, Expression]): CreateTableLikeCommand.this.type
    Definition Classes
    QueryPlan
  115. def transformUp(rule: PartialFunction[LogicalPlan, LogicalPlan]): LogicalPlan
    Definition Classes
    TreeNode
  116. def transformUpWithBeforeAndAfterRuleOnChildren(cond: (LogicalPlan) => Boolean, ruleId: RuleId)(rule: PartialFunction[(LogicalPlan, LogicalPlan), LogicalPlan]): LogicalPlan
    Definition Classes
    TreeNode
  117. def transformUpWithNewOutput(rule: PartialFunction[LogicalPlan, (LogicalPlan, Seq[(Attribute, Attribute)])], skipCond: (LogicalPlan) => Boolean, canGetOutput: (LogicalPlan) => Boolean): LogicalPlan
    Definition Classes
    AnalysisHelper → QueryPlan
  118. def transformUpWithPruning(cond: (TreePatternBits) => Boolean, ruleId: RuleId)(rule: PartialFunction[LogicalPlan, LogicalPlan]): LogicalPlan
    Definition Classes
    AnalysisHelper → TreeNode
  119. def transformUpWithSubqueries(f: PartialFunction[LogicalPlan, LogicalPlan]): LogicalPlan
    Definition Classes
    QueryPlan
  120. def transformWithPruning(cond: (TreePatternBits) => Boolean, ruleId: RuleId)(rule: PartialFunction[LogicalPlan, LogicalPlan]): LogicalPlan
    Definition Classes
    TreeNode
  121. def transformWithSubqueries(f: PartialFunction[LogicalPlan, LogicalPlan]): LogicalPlan
    Definition Classes
    QueryPlan
  122. lazy val treePatternBits: BitSet
    Definition Classes
    QueryPlan → TreeNode → TreePatternBits
  123. def treeString(append: (String) => Unit, verbose: Boolean, addSuffix: Boolean, maxFields: Int, printOperatorId: Boolean): Unit
    Definition Classes
    TreeNode
  124. final def treeString(verbose: Boolean, addSuffix: Boolean, maxFields: Int, printOperatorId: Boolean): String
    Definition Classes
    TreeNode
  125. final def treeString: String
    Definition Classes
    TreeNode
  126. def unsetTagValue[T](tag: TreeNodeTag[T]): Unit
    Definition Classes
    TreeNode
  127. def updateOuterReferencesInSubquery(plan: LogicalPlan, attrMap: AttributeMap[Attribute]): LogicalPlan
    Definition Classes
    AnalysisHelper → QueryPlan
  128. def verboseString(maxFields: Int): String
    Definition Classes
    QueryPlan → TreeNode
  129. def verboseStringWithOperatorId(): String
    Definition Classes
    QueryPlan
  130. def verboseStringWithSuffix(maxFields: Int): String
    Definition Classes
    LogicalPlan → TreeNode
  131. final def withNewChildren(newChildren: Seq[LogicalPlan]): LogicalPlan
    Definition Classes
    TreeNode
  132. def withNewChildrenInternal(newChildren: IndexedSeq[LogicalPlan]): LogicalPlan
    Definition Classes
    LeafLike