Skip to content
New issue

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

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

Already on GitHub? # to your account

[Bug]: DuckDB source errors with 'Error: Unsupported object type: null' then first row has NULL values #3044

Open
ebardelli opened this issue Jan 25, 2025 · 0 comments
Labels
bug Something isn't working customer request An Evidence customer has requested this to-review Evidence team to review

Comments

@ebardelli
Copy link
Contributor

Describe the bug

I'm running a DuckDB source. The query runs without issues in DuckDB. However, evidence returns the following error when running the source:

Error: Unsupported object type: null

The source of the bug should be this function.

The expected behavior should be using the first non-null value in the column or using the native types that DuckDB sets for the column (like for other connectors).

Steps to Reproduce

Setup a duckdb source test.sql:

CREATE TEMPORARY TABLE t1 (i INTEGER, j INTEGER);

INSERT INTO t1 (i, j)
VALUES 
    (1, NULL), 
    (2, 1);

select * from t1;

The source should error with:

  test ✖ Error: Unsupported object type: null

while the table is a viable duckdb table:

┌───────┬───────┐
│   i   │   j   │
│ int32 │ int32 │
├───────┼───────┤
│     1 │       │
│     2 │     1 │
└───────┴───────┘

Logs

N/A

System Info

System:
    OS: macOS 15.2
    CPU: (10) arm64 Apple M1 Pro
    Memory: 567.25 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.11.0 - ~/.nvm/versions/node/v22.11.0/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 11.0.0 - ~/.nvm/versions/node/v22.11.0/bin/npm
    pnpm: 10.0.0 - /opt/homebrew/bin/pnpm
  Browsers:
    Chrome: 132.0.6834.84
    Safari: 18.2
  npmPackages:
    @evidence-dev/bigquery: ^2.0.7 => 2.0.9 
    @evidence-dev/connector-gsheets: ^1.1.0 => 1.1.0 
    @evidence-dev/core-components: ^5.1.0 => 5.1.0 
    @evidence-dev/csv: ^1.0.13 => 1.0.14 
    @evidence-dev/databricks: ^1.0.7 => 1.0.8 
    @evidence-dev/duckdb: ^1.0.12 => 1.0.13 
    @evidence-dev/evidence: ^40.0.6 => 40.0.6 
    @evidence-dev/motherduck: ^1.0.3 => 1.0.4 
    @evidence-dev/mssql: ^1.1.1 => 1.1.2 
    @evidence-dev/mysql: ^1.1.3 => 1.1.4 
    @evidence-dev/postgres: ^1.0.6 => 1.0.7 
    @evidence-dev/sdk: ^3.0.1 => 3.0.6 
    @evidence-dev/snowflake: ^1.1.1 => 1.2.2 
    @evidence-dev/source-javascript: ^0.0.2 => 0.0.2 
    @evidence-dev/sqlite: ^2.0.7 => 2.0.7 
    @evidence-dev/trino: ^1.0.8 => 1.0.9 
    @sveltejs/adapter-static: ^3.0.5 => 3.0.6

Severity

annoyance

Additional Information, or Workarounds

The only workaround I found is to manually set a placeholder for the NULL value (e.g., -1) and then replace it back to a NULL after loading the data in evidence.

@ebardelli ebardelli added bug Something isn't working to-review Evidence team to review labels Jan 25, 2025
@github-actions github-actions bot added the customer request An Evidence customer has requested this label Jan 25, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working customer request An Evidence customer has requested this to-review Evidence team to review
Projects
None yet
Development

No branches or pull requests

1 participant