nineinchnick / trino-openapi

Trino connectors for accessing APIs with an OpenAPI spec
Apache License 2.0
28 stars 7 forks source link

Missing columns for 'v2/search/basic' API from Atlas #64

Closed saurabh-shinde closed 8 months ago

saurabh-shinde commented 8 months ago

Hi, We are trying to enable Apache Atlas as a catalog using this connector. But we are noticing issue with query results for 'v2_search_basic' table from this catalog.

But we are unable to see all columns from response in query results

Connector version - 1.31 API specification

nineinchnick commented 8 months ago

Which columns are missing?

saurabh-shinde commented 8 months ago

We are not seeing entities in query results, which is the crucial one as it has details for entities that match search results API response:

queryType
searchParameters
queryText
entities
approximateCount

Query result:

full_text_result
type_name
approximate_count
offset
exclude_deleted_entities
query
classification_req
sort_by
query_type
type
classification
search_parameters
next_marker
marker
limit
referred_entities
attributes
sort_order
query_text
nineinchnick commented 8 months ago

This is because entities are an array of AtlasEntityHeader and it's defined as:

      "AtlasEntityHeader": {
        "title": "AtlasEntityHeader",
        "description": "An instance of an entity - like hive_table, hive_database.",
        "allOf": [
          { "$ref": "#/components/schemas/AtlasStruct" },
          {
            "type": "object",
            "properties": {
              "classificationNames": {
                "type": "array",
                "description": "",
                "items": { "type": "string" }
              },
              "classifications": {
                "type": "array",
                "description": "",
                "items": { "$ref": "#/components/schemas/AtlasClassification" }
              },
              "displayText": { "type": "string", "description": "" },
              "guid": { "type": "string", "description": "" },
              "isIncomplete": { "type": "boolean", "description": "" },
              "labels": {
                "type": "array",
                "description": "",
                "items": { "type": "string" }
              },
              "meaningNames": {
                "type": "array",
                "description": "",
                "items": { "type": "string" }
              },
              "meanings": {
                "type": "array",
                "description": "",
                "items": {
                  "$ref": "#/components/schemas/AtlasTermAssignmentHeader"
                }
              },
              "status": { "$ref": "#/components/schemas/Status" }
            }
          }
        ]
      },

There's a allOf union type that's not supported. There's an existing issue to support fields like this: #52

nineinchnick commented 7 months ago

I've got a workaround in #66 to treat such union types as string