Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ abstract class LogicalPlan extends QueryPlan[LogicalPlan] with Logging {
if (tmp.nonEmpty) throw e
inBacktick = true
} else if (char == '.') {
if (tmp.isEmpty) throw e
if (name(i - 1) == '.' || i == name.length - 1) throw e
nameParts += tmp.mkString
tmp.clear()
} else {
Expand All @@ -170,7 +170,7 @@ abstract class LogicalPlan extends QueryPlan[LogicalPlan] with Logging {
}
i += 1
}
if (tmp.isEmpty || inBacktick) throw e
if (inBacktick) throw e
nameParts += tmp.mkString
nameParts.toSeq
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -730,4 +730,11 @@ class DataFrameSuite extends QueryTest {
val res11 = ctx.range(-1).select("id")
assert(res11.count == 0)
}

test("SPARK-8621: support empty string column name") {
val df = Seq(Tuple1(1)).toDF("").as("t")
// We should allow empty string as column name
df.col("")
df.col("t.``")
}
}