Coder Social home page Coder Social logo

duckdb-wasm-minimal-bug-example's Introduction

Reproduction of a weird bug in duckdb-wasm

Installation

  • Run ./start_node.js to start a local nodejs server.
  • Open a browser to localhost:8001
  • In the browser, open WORKS.html. It works.
  • In the browser, open DOES_NOT_WORK.html. It does not work and fails with the following error:
Uncaught RuntimeError: null function or function signature mismatch
    at U.onMessage (async_bindings.ts:150:23)

The only difference between WORKS.html and DOES_NOT_WORK.html is that they load different files.

  • WORKS.html loads diff_without_index.db
  • DOES_NOT_WORK.html loads diff_with_index.db

The two files were generated exactly the same way in Python, the only difference is that when generating diff_with_index.db, I created an index on the table sample_0 with the following query (using the Python API):

conn.execute("""
    CREATE UNIQUE INDEX sample_0_idx ON sample_0 (__SAMPLE_ID__);
""")

Investigation

I also added a Python script to showcase that the problems seems to come from duckdb-wasm itself, not duckdb.

It only require to have the duckdb Python package installed. Personnaly I use Python Poetry but any setup (virtualenv + pip or else) should be fine.

To use it with Poetry, just run:

  • poetry env use 3.8
  • poetry update
  • poetry run python WORKS.py works (and loads diff_without_index.db)
  • poetry run python WORKS_TOO.py works too (and loads diff_with_index.db)

About the data

Nothing to worry about: the data files were generated from a French OpenData dataset:

I'm using them to showcase an example for my data-diff tool which use duckdb-wasm to build the html report: https://furcypin.github.io/spark-frame/use_cases/comparing_dataframes/#french-gas-price

duckdb-wasm-minimal-bug-example's People

Contributors

furcypin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.