mirror of
https://github.com/apache/superset.git
synced 2024-09-12 08:39:45 -04:00
Disable Datasource sql polymorphism & Fix refresh Druid metadata.
This commit is contained in:
parent
10a1eddaa7
commit
7a7eb33348
@ -840,8 +840,12 @@ class DruidDatasource(Model, AuditMixinNullable, Queryable):
|
|||||||
return
|
return
|
||||||
max_time = results[0]['result']['maxTime']
|
max_time = results[0]['result']['maxTime']
|
||||||
max_time = parse(max_time)
|
max_time = parse(max_time)
|
||||||
intervals = (max_time - timedelta(seconds=1)).isoformat() + '/'
|
# Query segmentMetadata for 7 days back. However, due to a bug,
|
||||||
intervals += (max_time + timedelta(seconds=1)).isoformat()
|
# we need to set this interval to more than 1 day ago to exclude realtime segments, which
|
||||||
|
# trigged a bug (fixed in druid 0.8.2).
|
||||||
|
# https://groups.google.com/forum/#!topic/druid-user/gVCqqspHqOQ
|
||||||
|
intervals = (max_time - timedelta(days=7)).isoformat() + '/'
|
||||||
|
intervals += (max_time - timedelta(days=1)).isoformat()
|
||||||
segment_metadata = client.segment_metadata(
|
segment_metadata = client.segment_metadata(
|
||||||
datasource=self.datasource_name,
|
datasource=self.datasource_name,
|
||||||
intervals=intervals)
|
intervals=intervals)
|
||||||
@ -1114,7 +1118,8 @@ class DruidColumn(Model):
|
|||||||
datasource_name = Column(
|
datasource_name = Column(
|
||||||
String(250),
|
String(250),
|
||||||
ForeignKey('datasources.datasource_name'))
|
ForeignKey('datasources.datasource_name'))
|
||||||
datasource = relationship('DruidDatasource', backref='columns')
|
# Setting enable_typechecks=False disables polymorphic inheritance.
|
||||||
|
datasource = relationship('DruidDatasource', backref='columns', enable_typechecks=False)
|
||||||
column_name = Column(String(256))
|
column_name = Column(String(256))
|
||||||
is_active = Column(Boolean, default=True)
|
is_active = Column(Boolean, default=True)
|
||||||
type = Column(String(32))
|
type = Column(String(32))
|
||||||
|
Loading…
Reference in New Issue
Block a user