Skip to content

feat: add support for json register #47

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

Merged
merged 20 commits into from
Jan 3, 2024
Merged

feat: add support for json register #47

merged 20 commits into from
Jan 3, 2024

Conversation

vpbs2
Copy link
Contributor

@vpbs2 vpbs2 commented Dec 31, 2023

Add json register support

work-item: https://app.devrev.ai/devrev/works/ISS-72382

@vpbs2 vpbs2 changed the title feat: register json feat: add support for json register Dec 31, 2023
@vpbs2 vpbs2 marked this pull request as ready for review December 31, 2023 11:10
const startConversionTime = Date.now();

// Register the JSON content as a json file in the DuckDB.
await db.registerFileText(`${tableName}.json`, JSON.stringify(json));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove this plain text file from db after parquet is created


const connection = await db.connect();

const startConversionTime = Date.now();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of Date.now() can we use performance ?

metadata: { ...metadata, json },
});

await db.registerEmptyFileBuffer(`${tableName}.json`);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a small nit, you are create ${tableName}.json and ${tableName}.parquet a lot of time in this function, can we create a variable on top of the function ?

await page.waitForSelector('#loader', { timeout: 5000 });

// Wait for the loader to disappear
await page.waitForTimeout(1750);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't hardcode the values like this, based on machine it will change
Let's just check if the queries are running or not

@vpbs2 vpbs2 force-pushed the feat/reigster-json branch from d533339 to 0c12c75 Compare January 3, 2024 04:47
@vpbs2 vpbs2 merged commit 183a039 into main Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants