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

Specify behavior for empty or duplicate column names #137

Closed
krlmlr opened this issue May 4, 2017 · 6 comments
Closed

Specify behavior for empty or duplicate column names #137

krlmlr opened this issue May 4, 2017 · 6 comments

Comments

@krlmlr
Copy link
Member

krlmlr commented May 4, 2017

Supported e.g. by RSQLite and MySQL. Need to assign a unique name, can perhaps borrow from tibble::repair_names().

@krlmlr
Copy link
Member Author

krlmlr commented Jul 5, 2017

odbc seems to return a data frame with an empty column name for SELECT 1, CC @jimhester.

@jimhester
Copy link
Contributor

I actually prefer not assigning an arbitrary name for this, if someone writes the SQL without a name presumably it is for a reason and it seems strange to bring the data into R with one.

@krlmlr
Copy link
Member Author

krlmlr commented Jul 8, 2017

Many DBMS drivers will do this for you anyway. We could as well avoid specifying anything here, and leave it to the caller to repair column names.

@hadley @hannesmuehleisen: Any preference?

@hannes
Copy link

hannes commented Jul 8, 2017

MonetDB(Lite) will assign a column name if none is specified:

> str(dbGetQuery(con, "select 1, 1"))
'data.frame':	1 obs. of  2 variables:
 $ L2: int 1
 $ L4: int 1

@hadley
Copy link
Member

hadley commented Jul 8, 2017

I think we should require that the backend provides a valid data frame - i.e. no empty, NA, or duplicated column names.

@krlmlr
Copy link
Member Author

krlmlr commented Dec 18, 2017

Also need to make sure that dbColumnInfo() is consistent with that dbFetch() produces.

@krlmlr krlmlr closed this as completed in 8c0a637 Apr 26, 2018
krlmlr added a commit to r-dbi/DBI that referenced this issue Apr 26, 2018
krlmlr added a commit to r-dbi/RPostgres that referenced this issue Apr 26, 2018
krlmlr added a commit to r-dbi/RMariaDB that referenced this issue Apr 26, 2018
krlmlr added a commit to r-dbi/RSQLite that referenced this issue Apr 26, 2018
clrpackages pushed a commit to clearlinux-pkgs/R-RSQLite that referenced this issue Jul 23, 2018
… (default: `FALSE`) (r-dbi/DBI#141).

Kirill Müller (43):
      fledge: Bump version to 2.1.0.9000
      ignore
      safer tic
      export dbIsReadOnly()
      bump
      Revert "export dbIsReadOnly()"
      Deploy from Travis build 1509 [ci skip]
      Deploy from Travis build 1510 [ci skip]
      Deploy from Travis build 1511 [ci skip]
      Deploy from Travis build 1514 [ci skip]
      Deploy from Travis build 1515 [ci skip]
      Deploy from Travis build 1516 [ci skip]
      Deploy from Travis build 1530 [ci skip]
      Deploy from Travis build 1531 [ci skip]
      Deploy from Travis build 1533 [ci skip]
      install DBI and DBItest from GitHub
      reexport dbIsReadOnly() and dbCanConnect()
      implement format()
      implement dbRemoveTable(fail_if_missing = FALSE)
      document
      Deploy from Travis build 1539 [ci skip]
      use dbCreateTable() and dbAppendTable()
      Deploy from Travis build 1542 [ci skip]
      support bigint argument to dbConnect()
      Deploy from Travis build 1543 [ci skip]
      - Data frames resulting from a query always have unique non-empty column names (r-dbi/DBItest#137).
      collate
      - Support `temporary` argument in `dbRemoveTable()` (default: `FALSE`) (r-dbi/DBI#141).
      Deploy from Travis build 1546 [ci skip]
      reexport Id()
      oops
      fledge: Bump version to 2.1.0.9001
      up drake-based revdep
      test bioc but only one level deep
      add revdep results
      remove remotes, bump dependency
      fledge: Bump version to 2.1.1
      up CRAN comments
      reexport Id()
      Deploy from Travis build 1565 [ci skip]
      NEWS
      Deploy from Travis build 1566 [ci skip]
      Deploy from Travis build 1567 [ci skip]
@github-actions github-actions bot locked and limited conversation to collaborators Dec 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants