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

dbWriteTable failed with Error in .combine_results(res_list) : #278

Open
willshen99 opened this issue Nov 13, 2024 · 5 comments
Open

dbWriteTable failed with Error in .combine_results(res_list) : #278

willshen99 opened this issue Nov 13, 2024 · 5 comments

Comments

@willshen99
Copy link

I'm writing an in-memory table to hive catalog

DBI::dbWriteTable(con, "iris", iris)

It failed with error message:

Error in .combine_results(res_list) : 
  Chunk column names are different across chunks: []

It's same error message as #254. I also get the same error message with dbRemoveTable.

@willshen99
Copy link
Author

willshen99 commented Nov 13, 2024

The actual failure happened at dbCreateTable. It's same as described in table deletion issue #254 (comment). res_list is an empty list.

For dbWriteTable, adding use.one.query = T makes dbWriteTable to use dbCreateTableAs, thus bypassing this issue

@jarodmeng
Copy link
Contributor

I previously had trouble reproducing the error as I didn't have Hive installed and deployed on my machine. I will try to use Hive from docker rather than deploy a Hive server myself. If I can reproduce the error, I will try to fix it.

@willshen99
Copy link
Author

I don't think it's specific to Postgres. I have both hive and postgres catalog and they all failed with same error. Guessing it may due to updated Trino version: I'm using Trino 461.

I added a if empty check for dbFetch and seems fix the issue for our use case.
willshen99@5b48323#diff-311de06ae89550475debf15b8583a4baba7e227811e7cbd2865719713bf45051R68

I can submit a PR, if you think the fix makes sense and won't cause issue to other places.

@willshen99 willshen99 changed the title dbWriteTable failed for hive catalog dbWriteTable failed Dec 12, 2024
@willshen99 willshen99 changed the title dbWriteTable failed dbWriteTable failed with Error in .combine_results(res_list) : Dec 12, 2024
@jarodmeng
Copy link
Contributor

I tested using Trino 467 with a memory catalog and had no problem running dbWriteTable(). Without a reprex, it would be difficult for me to find out what went wrong and commit a fix.

@jarodmeng
Copy link
Contributor

If you can provide a reprex using a Docker image, it will make the troubleshooting much easier.

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

No branches or pull requests

2 participants