Skip to content
This repository was archived by the owner on Jan 28, 2021. It is now read-only.

sql/expression: relaxed json_extract #682

Merged
merged 1 commit into from
Apr 23, 2019
Merged

sql/expression: relaxed json_extract #682

merged 1 commit into from
Apr 23, 2019

Conversation

mcuadros
Copy link
Contributor

In the current implementation a query stops to be executed when one of the rows is empty or doesn't fit the json path expression, this PR allows any failure on the query to a value, but fails on a wrong expression.

if err != nil {
return nil, err
}

result[i], _ = c.Lookup(doc) // err ignored
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it's worth it to give some info to the user in this case using Warn:

ctx.Warn(0, err.Error())

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe that will be noise, because can be very common, since for example in my LOC if the language is not supported will be empty and then a warm

Copy link
Contributor

@ajnavarro ajnavarro left a comment

Choose a reason for hiding this comment

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

Could you add this new Function to all the documentation please?

Copy link
Contributor

@ajnavarro ajnavarro left a comment

Choose a reason for hiding this comment

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

Nevermind, wrong PR

@ajnavarro ajnavarro merged commit e0e8b6a into src-d:master Apr 23, 2019
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.

4 participants