Open Makesh-Gmak opened 5 years ago
Currently I have a SQLLachemy model like below with column_property(). But the PyDruid compils the query where BIGINT is converted to LONG, which leads to the error.
class wikipedia_model(Base): __tablename__ = 'wikipedia' page = Column(VARCHAR, primary_key=True) delta = Column(BIGINT) delta_round_off = column_property(cast(delta / 10, BIGINT) * 10) query = db_session.query(wikipedia_model).filter(wikipedia_model.page.like('%A')).limit(2) result = query.all()
Error:
sqlalchemy.exc.ProgrammingError: (pydruid.db.exceptions.ProgrammingError) Unknown exception (org.apache.calcite.tools.ValidationException): java.lang.UnsupportedOperationException: class org.apache.calcite.sql.SqlIdentifier: LONG [SQL: u'SELECT CAST("wikipedia"."delta" / %(param_1)s AS LONG) * %(param_2)s AS "anon_1", "wikipedia"."page" AS "wikipedia_page", "wikipedia"."delta" AS "wikipedia_delta" \nFROM "wikipedia" \nWHERE "wikipedia"."page" LIKE %(page_1)s\n LIMIT %(param_3)s'] [parameters: {u'page_1': '%A', u'param_1': 10, u'param_3': 2, u'param_2': 10}]
I observed the druid compiler is configured to return LONGfor BIGINTat https://github.com/druid-io/pydruid/blob/master/pydruid/db/sqlalchemy.py#L58
LONG
BIGINT
More info : https://github.com/apache/incubator-druid/blob/master/docs/content/querying/sql.md#data-types-and-casts
Is it still open?
Currently I have a SQLLachemy model like below with column_property(). But the PyDruid compils the query where BIGINT is converted to LONG, which leads to the error.
Error:
I observed the druid compiler is configured to return
LONG
forBIGINT
at https://github.com/druid-io/pydruid/blob/master/pydruid/db/sqlalchemy.py#L58More info : https://github.com/apache/incubator-druid/blob/master/docs/content/querying/sql.md#data-types-and-casts