查询的时候报错:Temporal data comparison should have the same data type?

我用如下代码创建了一个表:

login("admin", "123456")

if(existsDatabase("dfs://compoDB")){
    dropDatabase("dfs://compoDB")
}

n = 1000000
ID = rand(100, n)
dates = 2017.08.07T00:00:00.000..2017.08.08T00:00:00.000
date = rand(dates, n)
x = rand(10.0, n)
t = table(ID, date, x)

dbDate = database(, VALUE, 2017.08.07..2017.08.11)
dbID=database(, RANGE, 0 50 100)
db = database("dfs://compoDB", COMPO, [dbDate, dbID])

pt = db.createPartitionedTable(t, `pt, `date`ID)
pt.append!(t)

执行下面的查询语句:

select * from loadTable("dfs://compoDB", "pt") where date between 2017.08.07:2017.08.08

报如下错误:

select * from loadTable("dfs://compoDB", "pt") where date between 2017.08.07 : 2017.08.08 => Temporal data comparison should have the same data type.

请问哪里出了问题?

阅读 2k
1 个回答

应该与查询字段date的时间类型匹配,查询语句应该这样写:

select * from loadTable("dfs://compoDB", "pt") where date between 2017.08.07T00:00:00.000:2017.08.08T23:59:59.999

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
logo
101 新手上路
子站问答
访问
宣传栏