[regression test](http_stream) case for timezone (#27149)
It does not work now, anyway we need a case.
This commit is contained in:
@ -582,3 +582,18 @@
|
||||
10009 jj
|
||||
10010 kk
|
||||
|
||||
-- !sql15 --
|
||||
10000 aa 0
|
||||
10001 bb 0
|
||||
10002 cc 0
|
||||
10003 dd 0
|
||||
10004 ee 0
|
||||
10005 ff 0
|
||||
10006 gg 0
|
||||
10007 hh 0
|
||||
10008 ii 0
|
||||
10009 jj 0
|
||||
10010 kk 0
|
||||
|
||||
-- !sql15_1 --
|
||||
|
||||
|
||||
@ -15,8 +15,6 @@
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
suite("test_http_stream", "p0") {
|
||||
|
||||
// csv desc
|
||||
@ -640,5 +638,80 @@ suite("test_http_stream", "p0") {
|
||||
} finally {
|
||||
try_sql "DROP TABLE IF EXISTS ${tableName14}"
|
||||
}
|
||||
|
||||
// 15. test timezone
|
||||
def tableName15 = "test_http_stream_timezone"
|
||||
|
||||
try {
|
||||
sql """
|
||||
CREATE TABLE IF NOT EXISTS ${tableName15} (
|
||||
id int,
|
||||
name CHAR(10),
|
||||
cc int
|
||||
)
|
||||
DISTRIBUTED BY HASH(id) BUCKETS 1
|
||||
PROPERTIES (
|
||||
"replication_num" = "1"
|
||||
)
|
||||
"""
|
||||
|
||||
streamLoad {
|
||||
set 'version', '1'
|
||||
set 'timezone', 'America/Los_Angeles'
|
||||
set 'sql', """
|
||||
insert into ${db}.${tableName15} select c1, c2 , UNIX_TIMESTAMP('1970-01-01 08:00:00') from http_stream("format"="csv", "column_separator"="--")
|
||||
"""
|
||||
time 10000
|
||||
file 'test_http_stream_column_separator.csv'
|
||||
check { result, exception, startTime, endTime ->
|
||||
if (exception != null) {
|
||||
throw exception
|
||||
}
|
||||
log.info("http_stream result: ${result}".toString())
|
||||
def json = parseJson(result)
|
||||
assertEquals("success", json.Status.toLowerCase())
|
||||
}
|
||||
}
|
||||
|
||||
qt_sql15 "select id, name, cc from ${tableName15} order by id"
|
||||
} finally {
|
||||
try_sql "DROP TABLE IF EXISTS ${tableName15}"
|
||||
}
|
||||
|
||||
try {
|
||||
sql """
|
||||
CREATE TABLE IF NOT EXISTS ${tableName15} (
|
||||
id int,
|
||||
name CHAR(10),
|
||||
cc int
|
||||
)
|
||||
DISTRIBUTED BY HASH(id) BUCKETS 1
|
||||
PROPERTIES (
|
||||
"replication_num" = "1"
|
||||
)
|
||||
"""
|
||||
|
||||
// TODO Wait until http_stream function is perfected.
|
||||
streamLoad {
|
||||
set 'version', '1'
|
||||
set 'timezone', 'Test'
|
||||
set 'sql', """
|
||||
insert into ${db}.${tableName15} select c1, c2 , UNIX_TIMESTAMP('1970-01-01 08:00:00') from http_stream("format"="csv", "column_separator"="--")
|
||||
"""
|
||||
time 10000
|
||||
file 'test_http_stream_column_separator.csv'
|
||||
check { result, exception, startTime, endTime ->
|
||||
if (exception != null) {
|
||||
throw exception
|
||||
}
|
||||
log.info("http_stream result: ${result}".toString())
|
||||
def json = parseJson(result)
|
||||
assertEquals("success", json.Status.toLowerCase())
|
||||
}
|
||||
qt_sql15_1 "select id, name, cc from ${tableName15} order by id"
|
||||
}
|
||||
} finally {
|
||||
try_sql "DROP TABLE IF EXISTS ${tableName15}"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user