Closed mattpollock closed 5 years ago
see https://stackoverflow.com/a/49410602/1785752
Reprex:
write
[{"a":"jkl","b":"mno","c":{"c1":"ghi","c2":{"c21":"abc","c22":"def"}}}]
to a file and get a spark session sc
sc
spk_df <- spark_read_json(sc, "tmp", "file:///path/to/test.json") spk_df %>% sdf_select(c.c2.c22) # # Source: table<sparklyr_tmp_7431373dca00> [?? x 1] # # Database: spark_connection # c2 # <chr> # 1 def
but the column name should be c22
c22
a work-around is to use spk_df %>% sdf_select(c22 = c.c2.c22)
spk_df %>% sdf_select(c22 = c.c2.c22)
see https://stackoverflow.com/a/49410602/1785752
Reprex:
write
to a file and get a spark session
sc
but the column name should be
c22