Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Trino - ZodError on simple query #2823

Open
andreapiso opened this issue Nov 20, 2024 · 4 comments
Open

[Bug]: Trino - ZodError on simple query #2823

andreapiso opened this issue Nov 20, 2024 · 4 comments
Labels
bug Something isn't working to-review Evidence team to review

Comments

@andreapiso
Copy link

andreapiso commented Nov 20, 2024

Describe the bug

Running a simple query select * from table and getting a validation error from Zod. `count(*) on the same table succeeds, so it is not a connection issue.

{
    "code": "invalid_union",
    "unionErrors": [
      {
        "issues": [
          {
            "code": "invalid_union",
            "unionErrors": [
              {
                "issues": [
                  {
                    "expected": "'boolean' | 'number' | 'string' | 'date'",
                    "received": "undefined",
                    "code": "invalid_type",
                    "path": [
                      "columnTypes",
                      8,
                      "evidenceType"
                    ],
                    "message": "Required"
                  },
                  {
                    "expected": "'boolean' | 'number' | 'string' | 'date'",
                    "received": "undefined",
                    "code": "invalid_type",
                    "path": [
                      "columnTypes",
                      9,
                      "evidenceType"
                    ],
                    "message": "Required"
                  },
                  {
                    "expected": "'boolean' | 'number' | 'string' | 'date'",
                    "received": "undefined",
                    "code": "invalid_type",
                    "path": [
                      "columnTypes",
                      10,
                      "evidenceType"
                    ],
                    "message": "Required"
                  },
                  {
                    "expected": "'boolean' | 'number' | 'string' | 'date'",
                    "received": "undefined",
                    "code": "invalid_type",
                    "path": [
                      "columnTypes",
                      11,
                      "evidenceType"
                    ],
                    "message": "Required"
                  },
                  {
                    "code": "invalid_type",
                    "expected": "string",
                    "received": "undefined",
                    "path": [
                      "url"
                    ],
                    "message": "Required"
                  }
                ],
                "name": "ZodError"
              },
              {
                "issues": [
                  {
                    "expected": "'boolean' | 'number' | 'string' | 'date'",
                    "received": "undefined",
                    "code": "invalid_type",
                    "path": [
                      "columnTypes",
                      8,
                      "evidenceType"
                    ],
                    "message": "Required"
                  },
                  {
                    "expected": "'boolean' | 'number' | 'string' | 'date'",
                    "received": "undefined",
                    "code": "invalid_type",
                    "path": [
                      "columnTypes",
                      9,
                      "evidenceType"
                    ],
                    "message": "Required"
                  },
                  {
                    "expected": "'boolean' | 'number' | 'string' | 'date'",
                    "received": "undefined",
                    "code": "invalid_type",
                    "path": [
                      "columnTypes",
                      10,
                      "evidenceType"
                    ],
                    "message": "Required"
                  },
                  {
                    "expected": "'boolean' | 'number' | 'string' | 'date'",
                    "received": "undefined",
                    "code": "invalid_type",
                    "path": [
                      "columnTypes",
                      11,
                      "evidenceType"
                    ],
                    "message": "Required"
                  }
                ],
                "name": "ZodError"
              }
            ],
            "path": [],
            "message": "Invalid input"
          }
        ],
        "name": "ZodError"
      },
      {
        "issues": [
          {
            "code": "invalid_type",
            "expected": "null",
            "received": "object",
            "path": [],
            "message": "Expected null, received object"
          }
        ],
        "name": "ZodError"
      }
    ],
    "path": [],
    "message": "Invalid input"
  }
]

First time using evidence, is there any way to understand what's going on here? Or any verbose mode to help me debug the issue?
Running npm run sources -- --debug produces exactly the same output.

Steps to Reproduce

Just querying my fairly large table. The query succeeds according to starburst galaxy "Query Insights"

Logs

System Info

Severity

blocking all usage of Evidence

Additional Information, or Workarounds

No response

@andreapiso andreapiso added bug Something isn't working to-review Evidence team to review labels Nov 20, 2024
@andreapiso
Copy link
Author

I isolated the bug to my timestamp column ie if I query that column it breaks, but if i cast to DATE it works. Is TIMESTAMP not supported? Where can we see the supported types?

@archiewood
Copy link
Member

@andreapiso
Copy link
Author

My type is TIMESTAMP(6) Querying it caused the cryptic zod error above

@archiewood
Copy link
Member

It appears timestamp(6) is not currently supported.

It's not on the list of supported types in the connector.

Can you cast to timestamp also?

Would also accept a PR to add the type!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working to-review Evidence team to review
Projects
None yet
Development

No branches or pull requests

2 participants