org.apache.spark.sql.AnalysisException: cannot resolve 'd' given input columns _c0; line 1 pos 7

github.com | 9 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    [SPARK-5817] [SQL] Fix bug of udtf with column names by chenghao-intel · Pull Request #4602 · apache/spark · GitHub

    github.com | 9 months ago
    org.apache.spark.sql.AnalysisException: cannot resolve 'd' given input columns _c0; line 1 pos 7
  2. 0

    Spark 1.4.0 org.apache.spark.sql.AnalysisException: cannot resolve 'probability' given input columns

    Stack Overflow | 2 years ago | Lokesh Kumar P
    org.apache.spark.sql.AnalysisException: cannot resolve 'probability' given input columns id, prediction, labelStr, data, features, words, label;
  3. 0

    My code: {quote} case class TestData(key: Int, value: String) case class TestData2(a: Int, b: Int) import org.apache.spark.sql.execution.joins._ import sqlContext.implicits._ val testData = sc.parallelize( (1 to 100).map(i => TestData(i, i.toString))).toDF() testData.registerTempTable("testData") val testData2 = sc.parallelize( TestData2(1, 1) :: TestData2(1, 2) :: TestData2(2, 1) :: TestData2(2, 2) :: TestData2(3, 1) :: TestData2(3, 2) :: Nil, 2).toDF() testData2.registerTempTable("testData2") //val tmp = sqlContext.sql("SELECT * FROM testData *LEFT SEMI JOIN* testData2 ON key = a ") val tmp = sqlContext.sql("SELECT testData2.b, count(testData2.b) FROM testData *LEFT SEMI JOIN* testData2 ON key = testData2.a group by testData2.b") tmp.explain() {quote} Error log: {quote} org.apache.spark.sql.AnalysisException: cannot resolve 'testData2.b' given input columns key, value; line 1 pos 108 at org.apache.spark.sql.catalyst.analysis.package$AnalysisErrorAt.failAnalysis(package.scala:42) at org.apache.spark.sql.catalyst.analysis.CheckAnalysis$$anonfun$apply$3$$anonfun$apply$1.applyOrElse(CheckAnalysis.scala:48) at org.apache.spark.sql.catalyst.analysis.CheckAnalysis$$anonfun$apply$3$$anonfun$apply$1.applyOrElse(CheckAnalysis.scala:45) at org.apache.spark.sql.catalyst.trees.TreeNode$$anonfun$transformUp$1.apply(TreeNode.scala:250) at org.apache.spark.sql.catalyst.trees.TreeNode$$anonfun$transformUp$1.apply(TreeNode.scala:250) at org.apache.spark.sql.catalyst.trees.CurrentOrigin$.withOrigin(TreeNode.scala:50) at org.apache.spark.sql.catalyst.trees.TreeNode.transformUp(TreeNode.scala:249) at org.apache.spark.sql.catalyst.plans.QueryPlan.org$apache$spark$sql$catalyst$plans$QueryPlan$$transformExpressionUp$1(QueryPlan.scala:103) at org.apache.spark.sql.catalyst.plans.QueryPlan$$anonfun$2$$anonfun$apply$2.apply(QueryPlan.scala:117) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) at scala.collection.immutable.List.foreach(List.scala:318) {quote} {quote}SELECT * FROM testData LEFT SEMI JOIN testData2 ON key = a{quote} is correct, {quote} SELECT a FROM testData LEFT SEMI JOIN testData2 ON key = a SELECT max(value) FROM testData LEFT SEMI JOIN testData2 ON key = a group by b SELECT max(value) FROM testData LEFT SEMI JOIN testData2 ON key = testData2.a group by testData2.b SELECT testData2.b, count(testData2.b) FROM testData LEFT SEMI JOIN testData2 ON key = testData2.a group by testData2.b {quote} are incorrect.

    Apache's JIRA Issue Tracker | 2 years ago | Zhichao Zhang
    org.apache.spark.sql.AnalysisException: cannot resolve 'testData2.b' given input columns key, value; line 1 pos 108
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    My code: {quote} case class TestData(key: Int, value: String) case class TestData2(a: Int, b: Int) import org.apache.spark.sql.execution.joins._ import sqlContext.implicits._ val testData = sc.parallelize( (1 to 100).map(i => TestData(i, i.toString))).toDF() testData.registerTempTable("testData") val testData2 = sc.parallelize( TestData2(1, 1) :: TestData2(1, 2) :: TestData2(2, 1) :: TestData2(2, 2) :: TestData2(3, 1) :: TestData2(3, 2) :: Nil, 2).toDF() testData2.registerTempTable("testData2") //val tmp = sqlContext.sql("SELECT * FROM testData *LEFT SEMI JOIN* testData2 ON key = a ") val tmp = sqlContext.sql("SELECT testData2.b, count(testData2.b) FROM testData *LEFT SEMI JOIN* testData2 ON key = testData2.a group by testData2.b") tmp.explain() {quote} Error log: {quote} org.apache.spark.sql.AnalysisException: cannot resolve 'testData2.b' given input columns key, value; line 1 pos 108 at org.apache.spark.sql.catalyst.analysis.package$AnalysisErrorAt.failAnalysis(package.scala:42) at org.apache.spark.sql.catalyst.analysis.CheckAnalysis$$anonfun$apply$3$$anonfun$apply$1.applyOrElse(CheckAnalysis.scala:48) at org.apache.spark.sql.catalyst.analysis.CheckAnalysis$$anonfun$apply$3$$anonfun$apply$1.applyOrElse(CheckAnalysis.scala:45) at org.apache.spark.sql.catalyst.trees.TreeNode$$anonfun$transformUp$1.apply(TreeNode.scala:250) at org.apache.spark.sql.catalyst.trees.TreeNode$$anonfun$transformUp$1.apply(TreeNode.scala:250) at org.apache.spark.sql.catalyst.trees.CurrentOrigin$.withOrigin(TreeNode.scala:50) at org.apache.spark.sql.catalyst.trees.TreeNode.transformUp(TreeNode.scala:249) at org.apache.spark.sql.catalyst.plans.QueryPlan.org$apache$spark$sql$catalyst$plans$QueryPlan$$transformExpressionUp$1(QueryPlan.scala:103) at org.apache.spark.sql.catalyst.plans.QueryPlan$$anonfun$2$$anonfun$apply$2.apply(QueryPlan.scala:117) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) at scala.collection.immutable.List.foreach(List.scala:318) {quote} {quote}SELECT * FROM testData LEFT SEMI JOIN testData2 ON key = a{quote} is correct, {quote} SELECT a FROM testData LEFT SEMI JOIN testData2 ON key = a SELECT max(value) FROM testData LEFT SEMI JOIN testData2 ON key = a group by b SELECT max(value) FROM testData LEFT SEMI JOIN testData2 ON key = testData2.a group by testData2.b SELECT testData2.b, count(testData2.b) FROM testData LEFT SEMI JOIN testData2 ON key = testData2.a group by testData2.b {quote} are incorrect.

    Apache's JIRA Issue Tracker | 2 years ago | Zhichao Zhang
    org.apache.spark.sql.AnalysisException: cannot resolve 'testData2.b' given input columns key, value; line 1 pos 108

    Root Cause Analysis

    1. org.apache.spark.sql.AnalysisException

      cannot resolve 'd' given input columns _c0; line 1 pos 7

      at org.apache.spark.sql.catalyst.analysis.package$AnalysisErrorAt.failAnalysis()
    2. Spark Project Catalyst
      QueryPlan$$anonfun$2$$anonfun$apply$2.apply
      1. org.apache.spark.sql.catalyst.analysis.package$AnalysisErrorAt.failAnalysis(package.scala:42)
      2. org.apache.spark.sql.catalyst.analysis.CheckAnalysis$$anonfun$apply$3$$anonfun$apply$1.applyOrElse(CheckAnalysis.scala:48)
      3. org.apache.spark.sql.catalyst.analysis.CheckAnalysis$$anonfun$apply$3$$anonfun$apply$1.applyOrElse(CheckAnalysis.scala:45)
      4. org.apache.spark.sql.catalyst.trees.TreeNode$$anonfun$transformUp$1.apply(TreeNode.scala:250)
      5. org.apache.spark.sql.catalyst.trees.TreeNode$$anonfun$transformUp$1.apply(TreeNode.scala:250)
      6. org.apache.spark.sql.catalyst.trees.CurrentOrigin$.withOrigin(TreeNode.scala:50)
      7. org.apache.spark.sql.catalyst.trees.TreeNode.transformUp(TreeNode.scala:249)
      8. org.apache.spark.sql.catalyst.plans.QueryPlan.org$apache$spark$sql$catalyst$plans$QueryPlan$$transformExpressionUp$1(QueryPlan.scala:103)
      9. org.apache.spark.sql.catalyst.plans.QueryPlan$$anonfun$2$$anonfun$apply$2.apply(QueryPlan.scala:117)
      9 frames
    3. Scala
      AbstractTraversable.map
      1. scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
      2. scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
      3. scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
      4. scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
      5. scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
      6. scala.collection.AbstractTraversable.map(Traversable.scala:105)
      6 frames
    4. Spark Project Catalyst
      QueryPlan$$anonfun$2.apply
      1. org.apache.spark.sql.catalyst.plans.QueryPlan$$anonfun$2.apply(QueryPlan.scala:116)
      1 frame
    5. Scala
      Iterator$$anon$11.next
      1. scala.collection.Iterator$$anon$11.next(Iterator.scala:328)
      1 frame