org.apache.spark.sql.hive.execution

InsertIntoHiveTable

case class InsertIntoHiveTable(table: MetastoreRelation, partition: Map[String, Option[String]], child: SparkPlan, overwrite: Boolean, ifNotExists: Boolean) extends SparkPlan with UnaryExecNode with Product with Serializable

Command for writing data out to a Hive table.

This class is mostly a mess, for legacy reasons (since it evolved in organic ways and had to follow Hive's internal implementations closely, which itself was a mess too). Please don't blame Reynold for this! He was just moving code around!

In the future we should converge the write path for Hive with the normal data source write path, as defined in org.apache.spark.sql.execution.datasources.FileFormatWriter.

table

the logical plan representing the table. In the future this should be a org.apache.spark.sql.catalyst.catalog.CatalogTable once we converge Hive tables and data source tables.

partition

a map from the partition key to the partition value (optional). If the partition value is optional, dynamic partition insert will be performed. As an example, INSERT INTO tbl PARTITION (a=1, b=2) AS ... would have

Map('a' -> Some('1'), 'b' -> Some('2'))

and INSERT INTO tbl PARTITION (a=1, b) AS ... would have

Map('a' -> Some('1'), 'b' -> None)

.

child

the logical plan representing data to write to.

overwrite

overwrite existing table or partitions.

ifNotExists

If true, only write if the table or partition does not exist.

Linear Supertypes
UnaryExecNode, SparkPlan, Serializable, Serializable, Logging, QueryPlan[SparkPlan], TreeNode[SparkPlan], Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. InsertIntoHiveTable
  2. UnaryExecNode
  3. SparkPlan
  4. Serializable
  5. Serializable
  6. Logging
  7. QueryPlan
  8. TreeNode
  9. Product
  10. Equals
  11. AnyRef
  12. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new InsertIntoHiveTable(table: MetastoreRelation, partition: Map[String, Option[String]], child: SparkPlan, overwrite: Boolean, ifNotExists: Boolean)

    table

    the logical plan representing the table. In the future this should be a org.apache.spark.sql.catalyst.catalog.CatalogTable once we converge Hive tables and data source tables.

    partition

    a map from the partition key to the partition value (optional). If the partition value is optional, dynamic partition insert will be performed. As an example, INSERT INTO tbl PARTITION (a=1, b=2) AS ... would have

    Map('a' -> Some('1'), 'b' -> Some('2'))

    and INSERT INTO tbl PARTITION (a=1, b) AS ... would have

    Map('a' -> Some('1'), 'b' -> None)

    .

    child

    the logical plan representing data to write to.

    overwrite

    overwrite existing table or partitions.

    ifNotExists

    If true, only write if the table or partition does not exist.

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. lazy val allAttributes: AttributeSeq

    Definition Classes
    QueryPlan
  7. def apply(number: Int): TreeNode[_]

    Definition Classes
    TreeNode
  8. def argString: String

    Definition Classes
    TreeNode
  9. def asCode: String

    Definition Classes
    TreeNode
  10. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  11. lazy val canonicalized: SparkPlan

    Attributes
    protected
    Definition Classes
    QueryPlan
  12. val child: SparkPlan

    the logical plan representing data to write to.

    the logical plan representing data to write to.

    Definition Classes
    InsertIntoHiveTable → UnaryExecNode
  13. final def children: Seq[SparkPlan]

    Definition Classes
    UnaryExecNode → TreeNode
  14. lazy val cleanArgs: Seq[Any]

    Attributes
    protected
    Definition Classes
    QueryPlan
  15. def cleanExpression(e: Expression): Expression

    Attributes
    protected
    Definition Classes
    QueryPlan
  16. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  17. def collect[B](pf: PartialFunction[SparkPlan, B]): Seq[B]

    Definition Classes
    TreeNode
  18. def collectFirst[B](pf: PartialFunction[SparkPlan, B]): Option[B]

    Definition Classes
    TreeNode
  19. def collectLeaves(): Seq[SparkPlan]

    Definition Classes
    TreeNode
  20. lazy val constraints: ExpressionSet

    Definition Classes
    QueryPlan
  21. lazy val containsChild: Set[TreeNode[_]]

    Definition Classes
    TreeNode
  22. var createdTempDir: Option[Path]

  23. def doExecute(): RDD[InternalRow]

    Attributes
    protected
    Definition Classes
    InsertIntoHiveTable → SparkPlan
  24. def doExecuteBroadcast[T](): Broadcast[T]

    Attributes
    protected[org.apache.spark.sql]
    Definition Classes
    SparkPlan
  25. def doPrepare(): Unit

    Attributes
    protected
    Definition Classes
    SparkPlan
  26. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  27. final def execute(): RDD[InternalRow]

    Definition Classes
    SparkPlan
  28. final def executeBroadcast[T](): Broadcast[T]

    Definition Classes
    SparkPlan
  29. def executeCollect(): Array[InternalRow]

    Definition Classes
    InsertIntoHiveTable → SparkPlan
  30. def executeCollectPublic(): Array[Row]

    Definition Classes
    SparkPlan
  31. final def executeQuery[T](query: ⇒ T): T

    Attributes
    protected
    Definition Classes
    SparkPlan
  32. def executeTake(n: Int): Array[InternalRow]

    Definition Classes
    SparkPlan
  33. def executeToIterator(): Iterator[InternalRow]

    Definition Classes
    SparkPlan
  34. final def expressions: Seq[Expression]

    Definition Classes
    QueryPlan
  35. def fastEquals(other: TreeNode[_]): Boolean

    Definition Classes
    TreeNode
  36. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  37. def find(f: (SparkPlan) ⇒ Boolean): Option[SparkPlan]

    Definition Classes
    TreeNode
  38. def flatMap[A](f: (SparkPlan) ⇒ TraversableOnce[A]): Seq[A]

    Definition Classes
    TreeNode
  39. def foreach(f: (SparkPlan) ⇒ Unit): Unit

    Definition Classes
    TreeNode
  40. def foreachUp(f: (SparkPlan) ⇒ Unit): Unit

    Definition Classes
    TreeNode
  41. def generateTreeString(depth: Int, lastChildren: Seq[Boolean], builder: StringBuilder, verbose: Boolean, prefix: String): StringBuilder

    Definition Classes
    TreeNode
  42. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  43. def getExtTmpPathRelTo(path: Path): Path

  44. def getExternalTmpPath(path: Path): Path

  45. def getRelevantConstraints(constraints: Set[Expression]): Set[Expression]

    Attributes
    protected
    Definition Classes
    QueryPlan
  46. val hadoopConf: Configuration

  47. def hashCode(): Int

    Definition Classes
    TreeNode → AnyRef → Any
  48. val ifNotExists: Boolean

    If true, only write if the table or partition does not exist.

  49. def initializeLogIfNecessary(isInterpreter: Boolean): Unit

    Attributes
    protected
    Definition Classes
    Logging
  50. def innerChildren: Seq[QueryPlan[_]]

    Attributes
    protected
    Definition Classes
    QueryPlan → TreeNode
  51. def inputSet: AttributeSet

    Definition Classes
    QueryPlan
  52. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  53. def isTraceEnabled(): Boolean

    Attributes
    protected
    Definition Classes
    Logging
  54. def jsonFields: List[(String, JValue)]

    Attributes
    protected
    Definition Classes
    TreeNode
  55. def log: Logger

    Attributes
    protected
    Definition Classes
    Logging
  56. def logDebug(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Logging
  57. def logDebug(msg: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Logging
  58. def logError(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Logging
  59. def logError(msg: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Logging
  60. def logInfo(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Logging
  61. def logInfo(msg: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Logging
  62. def logName: String

    Attributes
    protected
    Definition Classes
    Logging
  63. def logTrace(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Logging
  64. def logTrace(msg: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Logging
  65. def logWarning(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Logging
  66. def logWarning(msg: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Logging
  67. def longMetric(name: String): SQLMetric

    Definition Classes
    SparkPlan
  68. def makeCopy(newArgs: Array[AnyRef]): SparkPlan

    Definition Classes
    SparkPlan → TreeNode
  69. def map[A](f: (SparkPlan) ⇒ A): Seq[A]

    Definition Classes
    TreeNode
  70. def mapChildren(f: (SparkPlan) ⇒ SparkPlan): SparkPlan

    Definition Classes
    TreeNode
  71. def mapExpressions(f: (Expression) ⇒ Expression): InsertIntoHiveTable.this.type

    Definition Classes
    QueryPlan
  72. def mapProductIterator[B](f: (Any) ⇒ B)(implicit arg0: ClassTag[B]): Array[B]

    Attributes
    protected
    Definition Classes
    TreeNode
  73. def metadata: Map[String, String]

    Definition Classes
    SparkPlan
  74. def metrics: Map[String, SQLMetric]

    Definition Classes
    SparkPlan
  75. def missingInput: AttributeSet

    Definition Classes
    QueryPlan
  76. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  77. def newMutableProjection(expressions: Seq[Expression], inputSchema: Seq[Attribute], useSubexprElimination: Boolean): MutableProjection

    Attributes
    protected
    Definition Classes
    SparkPlan
  78. def newNaturalAscendingOrdering(dataTypes: Seq[DataType]): Ordering[InternalRow]

    Attributes
    protected
    Definition Classes
    SparkPlan
  79. def newOrdering(order: Seq[SortOrder], inputSchema: Seq[Attribute]): Ordering[InternalRow]

    Attributes
    protected
    Definition Classes
    SparkPlan
  80. def newPredicate(expression: Expression, inputSchema: Seq[Attribute]): Predicate

    Attributes
    protected
    Definition Classes
    SparkPlan
  81. def newVersionExternalTempPath(path: Path): Path

  82. def nodeName: String

    Definition Classes
    TreeNode
  83. final def notify(): Unit

    Definition Classes
    AnyRef
  84. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  85. def numberedTreeString: String

    Definition Classes
    TreeNode
  86. def oldVersionExternalTempPath(path: Path): Path

  87. val origin: Origin

    Definition Classes
    TreeNode
  88. def otherCopyArgs: Seq[AnyRef]

    Attributes
    protected
    Definition Classes
    TreeNode
  89. def output: Seq[Attribute]

    Definition Classes
    InsertIntoHiveTable → QueryPlan
  90. def outputOrdering: Seq[SortOrder]

    Definition Classes
    SparkPlan
  91. def outputPartitioning: Partitioning

    Definition Classes
    InsertIntoHiveTable → SparkPlan
  92. def outputSet: AttributeSet

    Definition Classes
    QueryPlan
  93. val overwrite: Boolean

    overwrite existing table or partitions.

  94. def p(number: Int): SparkPlan

    Definition Classes
    TreeNode
  95. val partition: Map[String, Option[String]]

    a map from the partition key to the partition value (optional).

    a map from the partition key to the partition value (optional). If the partition value is optional, dynamic partition insert will be performed. As an example, INSERT INTO tbl PARTITION (a=1, b=2) AS ... would have

    Map('a' -> Some('1'), 'b' -> Some('2'))

    and INSERT INTO tbl PARTITION (a=1, b) AS ... would have

    Map('a' -> Some('1'), 'b' -> None)

    .

  96. final def prepare(): Unit

    Definition Classes
    SparkPlan
  97. def prepareSubqueries(): Unit

    Attributes
    protected
    Definition Classes
    SparkPlan
  98. def prettyJson: String

    Definition Classes
    TreeNode
  99. def printSchema(): Unit

    Definition Classes
    QueryPlan
  100. def producedAttributes: AttributeSet

    Definition Classes
    QueryPlan
  101. def references: AttributeSet

    Definition Classes
    QueryPlan
  102. def requiredChildDistribution: Seq[Distribution]

    Definition Classes
    SparkPlan
  103. def requiredChildOrdering: Seq[Seq[SortOrder]]

    Definition Classes
    SparkPlan
  104. def resetMetrics(): Unit

    Definition Classes
    SparkPlan
  105. def sameResult(plan: SparkPlan): Boolean

    Definition Classes
    QueryPlan
  106. lazy val schema: StructType

    Definition Classes
    QueryPlan
  107. def schemaString: String

    Definition Classes
    QueryPlan
  108. val scratchDir: String

  109. lazy val sideEffectResult: Seq[InternalRow]

    Inserts all the rows in the table into Hive.

    Inserts all the rows in the table into Hive. Row objects are properly serialized with the org.apache.hadoop.hive.serde2.SerDe and the org.apache.hadoop.mapred.OutputFormat provided by the table definition.

    Note: this is run once and then kept to avoid double insertions.

    Attributes
    protected[org.apache.spark.sql]
  110. def simpleString: String

    Definition Classes
    QueryPlan → TreeNode
  111. def sparkContext: SparkContext

    Attributes
    protected
    Definition Classes
    SparkPlan
  112. final val sqlContext: SQLContext

    Definition Classes
    SparkPlan
  113. val stagingDir: String

  114. def statePrefix: String

    Attributes
    protected
    Definition Classes
    QueryPlan
  115. def stringArgs: Iterator[Any]

    Attributes
    protected
    Definition Classes
    TreeNode
  116. val subexpressionEliminationEnabled: Boolean

    Definition Classes
    SparkPlan
  117. def subqueries: Seq[SparkPlan]

    Definition Classes
    QueryPlan
  118. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  119. val table: MetastoreRelation

    the logical plan representing the table.

    the logical plan representing the table. In the future this should be a org.apache.spark.sql.catalyst.catalog.CatalogTable once we converge Hive tables and data source tables.

  120. def toJSON: String

    Definition Classes
    TreeNode
  121. def toString(): String

    Definition Classes
    TreeNode → AnyRef → Any
  122. def transform(rule: PartialFunction[SparkPlan, SparkPlan]): SparkPlan

    Definition Classes
    TreeNode
  123. def transformAllExpressions(rule: PartialFunction[Expression, Expression]): InsertIntoHiveTable.this.type

    Definition Classes
    QueryPlan
  124. def transformDown(rule: PartialFunction[SparkPlan, SparkPlan]): SparkPlan

    Definition Classes
    TreeNode
  125. def transformExpressions(rule: PartialFunction[Expression, Expression]): InsertIntoHiveTable.this.type

    Definition Classes
    QueryPlan
  126. def transformExpressionsDown(rule: PartialFunction[Expression, Expression]): InsertIntoHiveTable.this.type

    Definition Classes
    QueryPlan
  127. def transformExpressionsUp(rule: PartialFunction[Expression, Expression]): InsertIntoHiveTable.this.type

    Definition Classes
    QueryPlan
  128. def transformUp(rule: PartialFunction[SparkPlan, SparkPlan]): SparkPlan

    Definition Classes
    TreeNode
  129. def treeString(verbose: Boolean): String

    Definition Classes
    TreeNode
  130. def treeString: String

    Definition Classes
    TreeNode
  131. def validConstraints: Set[Expression]

    Attributes
    protected
    Definition Classes
    QueryPlan
  132. def verboseString: String

    Definition Classes
    QueryPlan → TreeNode
  133. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  134. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  135. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  136. def waitForSubqueries(): Unit

    Attributes
    protected
    Definition Classes
    SparkPlan
  137. def withNewChildren(newChildren: Seq[SparkPlan]): SparkPlan

    Definition Classes
    TreeNode

Inherited from UnaryExecNode

Inherited from SparkPlan

Inherited from Serializable

Inherited from Serializable

Inherited from Logging

Inherited from QueryPlan[SparkPlan]

Inherited from TreeNode[SparkPlan]

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped