Skip to content

bug: Cannot Access INFORMATION_SCHEMA Tables in Apache Druid #10439

Open
@ongdisheng

Description

@ongdisheng

What happened?

When using Ibis with Apache Druid as backend, I’m unable to access the following tables from INFORMATION_SCHEMA: COLUMNS, ROUTINES, SCHEMATA, and TABLES. Only user-created tables (e.g., wikiticker-2015-09-12-sampled) are accessible, as shown in the log output.

What version of ibis are you using?

9.5.0

What backend(s) are you using, if any?

Druid

Relevant log output

import ibis
con = ibis.druid.connect()

print('Table list:', con.list_tables())
print(con.table('wikiticker-2015-09-12-sampled'))
print(con.table('COLUMNS'))

Table list: ['COLUMNS', 'ROUTINES', 'SCHEMATA', 'TABLES', 'segments', 'server_segments', 'servers', 'supervisors', 'tasks', 'wikiticker-2015-09-12-sampled']
DatabaseTable: wikiticker-2015-09-12-sampled
  __time         timestamp
  channel        string
  cityName       string
  comment        string
  countryIsoCode string
  countryName    string
  isAnonymous    string
  isMinor        string
  isNew          string
  isRobot        string
  isUnpatrolled  string
  metroCode      int64
  namespace      string
  page           string
  regionIsoCode  string
  regionName     string
  user           string
  delta          int64
  added          int64
  deleted        int64
Traceback (most recent call last):
  File "c:\Users\DI SHENG\Downloads\ibis\ibis_druid.py", line 6, in <module>
    print(con.table('COLUMNS'))
          ^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\DI SHENG\AppData\Local\Programs\Python\Python311\Lib\site-packages\ibis\backends\sql\__init__.py", line 137, in table
    table_schema = self.get_schema(name, catalog=catalog, database=database)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\DI SHENG\AppData\Local\Programs\Python\Python311\Lib\site-packages\ibis\backends\druid\__init__.py", line 157, in get_schema
    return self._get_schema_using_query(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\DI SHENG\AppData\Local\Programs\Python\Python311\Lib\site-packages\ibis\backends\druid\__init__.py", line 134, in _get_schema_using_query
    with self._safe_raw_sql(f"EXPLAIN PLAN FOR {query}") as result:
  File "C:\Users\DI SHENG\AppData\Local\Programs\Python\Python311\Lib\contextlib.py", line 137, in __enter__
    return next(self.gen)
           ^^^^^^^^^^^^^^
  File "C:\Users\DI SHENG\AppData\Local\Programs\Python\Python311\Lib\site-packages\ibis\backends\druid\__init__.py", line 130, in _safe_raw_sql
    cur.execute(query, *args, **kwargs)
  File "C:\Users\DI SHENG\AppData\Local\Programs\Python\Python311\Lib\site-packages\pydruid\db\api.py", line 72, in g
    return f(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\DI SHENG\AppData\Local\Programs\Python\Python311\Lib\site-packages\pydruid\db\api.py", line 271, in execute
    first_row = next(results)
                ^^^^^^^^^^^^^
  File "C:\Users\DI SHENG\AppData\Local\Programs\Python\Python311\Lib\site-packages\pydruid\db\api.py", line 386, in _stream_query
    raise exceptions.ProgrammingError(msg)
pydruid.db.exceptions.ProgrammingError: druidException (INVALID_INPUT): Object 'COLUMNS' not found (line [1], column [32])

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIncorrect behavior inside of ibis

    Type

    No type

    Projects

    Status

    backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions