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

Ch 6 Working With JSON #22

Open
evohnave opened this issue Jul 11, 2018 · 1 comment
Open

Ch 6 Working With JSON #22

evohnave opened this issue Jul 11, 2018 · 1 comment

Comments

@evohnave
Copy link
Contributor

Using Python...

Having trouble replicating the use of get_json_object and json_tuple (p110). One small issue is using "... as 'column'" [easily fixed with use of .alias("column") instead], but even when accounting for this I'm getting a "DataFrame object is not callable" error. If I replace the col("jsonString") with jsonDF.jsonString (where ever that is used) the error goes away. This sort of replicates what's in use in the documentation for get_json_object, so I'm guessing it's the right answer. And when I run this I get the results in the book...

Also, the SQL string only calls out one column, "column"... and it doesn't seem like the pure SQL code of previous examples, but I was able to reproduce the results.

If you see what I mean and agree I'll do a PR (errata page still down...)

Won't address the Scala code, but it looks as if it would have the same issues...

@JoeKastner
Copy link

Just came across this as well. .alias("column") worked for me when testing it out in DataBricks. I'll submit PR for this issue.

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