(
&self,
schema: &DFSchema,
planner_context: &mut PlannerContext,
value: Box<SQLExpr>,
path: &JsonPath,
)
| 662 | } |
| 663 | |
| 664 | fn parse_json_access( |
| 665 | &self, |
| 666 | schema: &DFSchema, |
| 667 | planner_context: &mut PlannerContext, |
| 668 | value: Box<SQLExpr>, |
| 669 | path: &JsonPath, |
| 670 | ) -> Result<Expr> { |
| 671 | let json_path = path.to_string(); |
| 672 | let json_path = if let Some(json_path) = json_path.strip_prefix(":") { |
| 673 | // sqlparser's JsonPath display adds an extra `:` at the beginning. |
| 674 | json_path.to_owned() |
| 675 | } else { |
| 676 | json_path |
| 677 | }; |
| 678 | self.build_logical_expr( |
| 679 | BinaryOperator::Custom(":".to_owned()), |
| 680 | self.sql_to_expr(*value, schema, planner_context)?, |
| 681 | // pass json path as a string literal, let the impl parse it when needed. |
| 682 | Expr::Literal(ScalarValue::Utf8(Some(json_path)), None), |
| 683 | schema, |
| 684 | ) |
| 685 | } |
| 686 | |
| 687 | /// Parses a struct(..) expression and plans it creation |
| 688 | fn parse_struct( |
no test coverage detected