Skip to content

Commit

Permalink
Disable Datasource sql polymorphism & Fix refresh Druid metadata.
Browse files Browse the repository at this point in the history
  • Loading branch information
kim-pham-airbnb committed Mar 25, 2016
1 parent 10a1edd commit 7a7eb33
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions dashed/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -840,8 +840,12 @@ def latest_metadata(self):
return
max_time = results[0]['result']['maxTime']
max_time = parse(max_time)
intervals = (max_time - timedelta(seconds=1)).isoformat() + '/'
intervals += (max_time + timedelta(seconds=1)).isoformat()
# Query segmentMetadata for 7 days back. However, due to a bug,
# 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(
datasource=self.datasource_name,
intervals=intervals)
Expand Down Expand Up @@ -1114,7 +1118,8 @@ class DruidColumn(Model):
datasource_name = Column(
String(250),
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))
is_active = Column(Boolean, default=True)
type = Column(String(32))
Expand Down

0 comments on commit 7a7eb33

Please sign in to comment.