Skip to content

Support for nested database fields #158

Description

@javierluraschi

It is increasingly common for databases to support unstructured data, for instance, in Apache Spark or Apache Drill; however, to my knowledge this might not be supported in dbplyr, is it?

A common case is to selected nested fields from within a field, two examples:

writeLines('[{"a":1,"b":{"a":10,"b":100}},{"a":2,"b":{"a":20,"b":200}}]', "test.json")

library(sparklyr)
sc <- spark_connect(master = "local")

nested_tbl <- spark_read_json(sc, "nested", "test.json")

# SQL query is supported
DBI::dbGetQuery(sc, "SELECT b.a FROM nested")
   a
1 10
2 20
# Query in dplyr...
nested_tbl %>% select(b.a)
 Error in .f(.x[[i]], ...) : object 'b.a' not found 

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancementfunc trans 🌍Translation of individual functions to SQL

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions