Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-3524

Drill proper DESCRIBE support for MongoDB

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.1.0
    • Future
    • Metadata, Storage - MongoDB
    • None

    Description

      Request to add full DESCRIBE support for MongoDB collections.

      I understand this may be difficult / sub-optimal due to the flexible schema nature of Mongo docs but if you can tabulate results when reading directly from MongoDB for which you have read the field names, then it's also possible to extract all field names to present for the describe command, albeit an inefficient scan to do so.

      Currently describe returns a pseudo / inaccurate / unhelpful metadata:

      +--------------+------------+--------------+
      | COLUMN_NAME  | DATA_TYPE  | IS_NULLABLE  |
      +--------------+------------+--------------+
      | *            | ANY        | YES          |
      +--------------+------------+--------------+

      Perhaps you could extend DESCRIBE to scan the first few dozen docs by default to create a merged schema as well as adding an optional argument to the describe command to allow for scanning a user-specified number of docs from which to describe the schema, or an ALL argument keyword to describe to scan all docs in a collection to get the complete global schema for the collection?

      In case of schema evolution it might be an interesting option to additionally read the newest and oldest records, maybe the first and last records by ID etc.

      Attachments

        Activity

          People

            Unassigned Unassigned
            harisekhon Hari Sekhon
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated: