fix(csv upload): hive params typo (#10273)

* fix(csv upload): fix :params typo

* fix tests
This commit is contained in:
serenajiang 2020-07-09 11:25:35 -07:00 committed by GitHub
parent c0d663db9a
commit c67b1abfd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -140,11 +140,11 @@ class HiveEngineSpec(PrestoEngineSpec):
}
if header_line_count is not None and header_line_count >= 0:
header_line_count += 1
tblproperties.append("'skip.header.line.count'=':header_line_count'")
tblproperties.append("'skip.header.line.count'=:header_line_count")
params["header_line_count"] = str(header_line_count)
if null_values:
# hive only supports 1 value for the null format
tblproperties.append("'serialization.null.format'=':null_value'")
tblproperties.append("'serialization.null.format'=:null_value")
params["null_value"] = null_values[0]
if tblproperties:

View File

@ -181,7 +181,7 @@ def test_get_create_table_stmt() -> None:
"""CREATE TABLE employee ( eid int, name String, salary String, destination String )
ROW FORMAT DELIMITED FIELDS TERMINATED BY :delim
STORED AS TEXTFILE LOCATION :location
tblproperties ('skip.header.line.count'=':header_line_count', 'serialization.null.format'=':null_value')""",
tblproperties ('skip.header.line.count'=:header_line_count, 'serialization.null.format'=:null_value)""",
{
"delim": ",",
"location": "s3a://directory/table",
@ -195,7 +195,7 @@ def test_get_create_table_stmt() -> None:
"""CREATE TABLE employee ( eid int, name String, salary String, destination String )
ROW FORMAT DELIMITED FIELDS TERMINATED BY :delim
STORED AS TEXTFILE LOCATION :location
tblproperties ('skip.header.line.count'=':header_line_count', 'serialization.null.format'=':null_value')""",
tblproperties ('skip.header.line.count'=:header_line_count, 'serialization.null.format'=:null_value)""",
{
"delim": ",",
"location": "s3a://directory/table",
@ -209,7 +209,7 @@ def test_get_create_table_stmt() -> None:
"""CREATE TABLE employee ( eid int, name String, salary String, destination String )
ROW FORMAT DELIMITED FIELDS TERMINATED BY :delim
STORED AS TEXTFILE LOCATION :location
tblproperties ('skip.header.line.count'=':header_line_count', 'serialization.null.format'=':null_value')""",
tblproperties ('skip.header.line.count'=:header_line_count, 'serialization.null.format'=:null_value)""",
{
"delim": ",",
"location": "s3a://directory/table",
@ -231,6 +231,6 @@ def test_get_create_table_stmt() -> None:
"""CREATE TABLE employee ( eid int, name String, salary String, destination String )
ROW FORMAT DELIMITED FIELDS TERMINATED BY :delim
STORED AS TEXTFILE LOCATION :location
tblproperties ('skip.header.line.count'=':header_line_count')""",
tblproperties ('skip.header.line.count'=:header_line_count)""",
{"delim": ",", "location": "s3a://directory/table", "header_line_count": "101"},
)