我使用Superset作为SQLite数据库的数据可视化工具。因为SQLite没有DATETIME类型,所以我使用TEXT类型来添加日期和小时。
然而,Superset然后不承认这个“TEXT”或String是约会!
这是我的数据:
CREATE TABLE TEST(
TEST_ID int PRIMARY KEY NOT NULL,
VEHICLE_ID int NULL,
TEST_TYPE_ID int NULL,
CHECK_TYPE_ID int NULL,
NUM_TEST int NULL,
TEST_DATE TEXT NOT NULL
);
INSERT INTO TEST (TEST_ID, VEHICLE_ID, TEST_TYPE_ID, CHECK_TYPE_ID, NUM_TEST, TEST_DATE) VALUES (844, 504, 3, 1, 3, '2007-01-01 10:00:00');
然后在Superset中我有以下信息:
“日期时间列未作为部分表格配置提供,并且是此类图表所必需的”
详细信息:
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/superset/viz.py", line 234, in get_payload
df = self.get_df()
File "/usr/lib/python2.7/site-packages/superset/viz.py", line 78, in get_df
self.results = self.datasource.query(query_obj)
File "/usr/lib/python2.7/site-packages/superset/connectors/sqla/models.py", line 538, in query
qry = self.get_sqla_query(**query_obj)
File "/usr/lib/python2.7/site-packages/superset/connectors/sqla/models.py", line 370, in get_sqla_query
"Datetime column not provided as part table configuration "
Exception: Datetime column not provided as part table configuration and is required by this type of chart
我尝试用TEXT AS DATETIME替换TEXT创建表,但这是一个语法错误。
你有解决方案吗?
答案 0 :(得分:0)
数据源编辑器中有一个设置。在“列”标签上,将“临时时间”标志更改为选中状态(true)