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

sql engine: check if there is more than one element #1837

Merged
merged 3 commits into from
Jun 22, 2020
Merged

sql engine: check if there is more than one element #1837

merged 3 commits into from
Jun 22, 2020

Conversation

randy3k
Copy link
Contributor

@randy3k randy3k commented Apr 21, 2020

When connecting to databases, columns may be of type bit64::integer64. If the length of first_column is less than or equal to 1. diff(first_column) == 1 will throw an error.

Nevertheless, it is not a problem if a database returns integer.

A similar issue has been reported here: https://community.rstudio.com/t/rpostgres-query-works-interactively-in-notebook-but-will-not-knit/14858 But it seems that no one has actually spotted the culprit.

> all(diff(bit64::integer64(1L)) == 1)
Error in if (n2%%n1) warning("length(e2) not a multiple length(e1)") :
  argument is not interpretable as logical

> all(diff(integer(1L)) == 1)
[1] TRUE

@randy3k randy3k changed the title check if there is more than one element sql: check if there is more than one element Apr 21, 2020
@randy3k randy3k changed the title sql: check if there is more than one element sql engine: check if there is more than one element Apr 21, 2020
Copy link
Owner

@yihui yihui left a comment

Choose a reason for hiding this comment

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

Thank you!

@yihui yihui merged commit c79aa3c into yihui:master Jun 22, 2020
@randy3k randy3k deleted the sql branch June 22, 2020 08:24
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants