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 @@ -166,10 +166,14 @@ private[sql] class DDLParser(
}
)

protected lazy val optionName: Parser[String] = "[_a-zA-Z][a-zA-Z0-9]*".r ^^ {
protected lazy val optionPart: Parser[String] = "[_a-zA-Z][_a-zA-Z0-9]*".r ^^ {
case name => name
}

protected lazy val optionName: Parser[String] = repsep(optionPart, ".") ^^ {
case parts => parts.mkString(".")
}

protected lazy val pair: Parser[(String, String)] =
optionName ~ stringLit ^^ { case k ~ v => (k, v) }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ class AllDataTypesScanSource extends SchemaRelationProvider {
sqlContext: SQLContext,
parameters: Map[String, String],
schema: StructType): BaseRelation = {
// Check that weird parameters are passed correctly.
parameters("option_with_underscores")
parameters("option.with.dots")

AllDataTypesScan(parameters("from").toInt, parameters("TO").toInt, schema)(sqlContext)
}
}
Expand Down Expand Up @@ -121,7 +125,9 @@ class TableScanSuite extends DataSourceTest {
|USING org.apache.spark.sql.sources.SimpleScanSource
|OPTIONS (
| From '1',
| To '10'
| To '10',
| option_with_underscores 'someval',
| option.with.dots 'someval'
|)
""".stripMargin)

Expand Down Expand Up @@ -152,7 +158,9 @@ class TableScanSuite extends DataSourceTest {
|USING org.apache.spark.sql.sources.AllDataTypesScanSource
|OPTIONS (
| From '1',
| To '10'
| To '10',
| option_with_underscores 'someval',
| option.with.dots 'someval'
|)
""".stripMargin)
}
Expand Down Expand Up @@ -354,7 +362,9 @@ class TableScanSuite extends DataSourceTest {
|USING org.apache.spark.sql.sources.AllDataTypesScanSource
|OPTIONS (
| from '1',
| to '10'
| to '10',
| option_with_underscores 'someval',
| option.with.dots 'someval'
|)
""".stripMargin)

Expand Down