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

Implement ENTRIES function #1315

Merged
merged 23 commits into from Jul 27, 2023
Merged

Implement ENTRIES function #1315

merged 23 commits into from Jul 27, 2023

Conversation

2-NOW
Copy link
Contributor

@2-NOW 2-NOW commented Jul 22, 2023

resolve #1290

@coveralls
Copy link

coveralls commented Jul 22, 2023

Pull Request Test Coverage Report for Build 5670676976

  • 41 of 45 (91.11%) changed or added relevant lines in 5 files are covered.
  • 28 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.04%) to 98.571%

Changes Missing Coverage Covered Lines Changed/Added Lines %
test-suite/src/function/entries.rs 18 22 81.82%
Files with Coverage Reduction New Missed Lines %
core/src/ast/mod.rs 1 99.83%
core/src/executor/aggregate/mod.rs 27 86.08%
Totals Coverage Status
Change from base Build 5658500467: -0.04%
Covered Lines: 46230
Relevant Lines: 46900

💛 - Coveralls

Ok(Evaluated::Value(Value::List(entries)))
}
_ => Err(EvaluateError::FunctionRequiresMapValue(name).into()),
}
Copy link
Collaborator

@zmrdltl zmrdltl Jul 22, 2023

Choose a reason for hiding this comment

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

only one test left!
https://coveralls.io/builds/61509376/source?filename=core%2Fsrc%2Fexecutor%2Fevaluate%2Ffunction.rs#L775

we can write this test like this

test!(
        "SELECT UNWRAP('abc', 'a.b.c') FROM MapType",
       Err(EvaluateError::FunctionRequiresMapValue("UNWRAP".to_owned()).into())
);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks for the feedback. i've applied it :)

};
test! {
name: "test if the sample string gets inserted to table",
sql: "INSERT INTO Item VALUES ('{\"name\":\"GlueSQL\"}')",
Copy link
Collaborator

Choose a reason for hiding this comment

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

we can use r# operator to remove '' for readable code

r#"INSERT INTO Item VALUES ('{"name":"GlueSQL"}')"#,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks for the feedback. i've applied it :)

@ever0de ever0de added the enhancement New feature or request label Jul 22, 2023
Copy link
Member

@panarch panarch left a comment

Choose a reason for hiding this comment

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

Looks all nice! Thanks a lot for the contribution 👍 👍

@panarch panarch self-requested a review July 22, 2023 14:36
@@ -1176,14 +1178,6 @@ mod tests {
))))
.to_sql()
);

assert_eq!(
Copy link
Member

Choose a reason for hiding this comment

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

this removal does not look intentional which is not related to this pr.

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 fixed :)

associated commit: 7d2eeb8

@panarch panarch self-requested a review July 24, 2023 14:28
Copy link
Member

@panarch panarch left a comment

Choose a reason for hiding this comment

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

Looks all nice! Thanks a lot for the contribution 👍 👍

@panarch panarch merged commit 3439d73 into gluesql:main Jul 27, 2023
9 checks passed
panarch pushed a commit that referenced this pull request Jul 28, 2023
Extract the last day of the month for the given date | timestamp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implementation ENTRIES for MAP
5 participants