ARROW-3845: [Gandiva] [GLib] Add GGandivaNode#3006
ARROW-3845: [Gandiva] [GLib] Add GGandivaNode#3006shiro615 wants to merge 20 commits intoapache:masterfrom
Conversation
096b924 to
6f15863
Compare
25a1d99 to
a4deb08
Compare
Codecov Report
@@ Coverage Diff @@
## master #3006 +/- ##
==========================================
+ Coverage 86.65% 87.67% +1.01%
==========================================
Files 491 424 -67
Lines 69513 64073 -5440
==========================================
- Hits 60239 56173 -4066
+ Misses 9182 7900 -1282
+ Partials 92 0 -92Continue to review full report at Codecov.
|
shiro615
left a comment
There was a problem hiding this comment.
Thank you for your support.
I’ve read each commit for details. This looks good.
|
|
||
| #define GGANDIVA_NODE_GET_PRIVATE(object) \ | ||
| static_cast<GGandivaNodePrivate *>( \ | ||
| ggandiva_node_get_instance_private( \ |
There was a problem hiding this comment.
Is that because G_TYPE_INSTANCE_GET_PRIVATE has been deprecated since version 2.58?
I'll send follow-up pull requests to remove G_TYPE_INSTANCE_GET_PRIVATE in other classes.
kou
left a comment
There was a problem hiding this comment.
Thanks!
It looks almost good. Can you check my comments?
| </part> | ||
|
|
||
| <part id="tree-expression-builder"> | ||
| <title>Tree Expression Builder</title> |
There was a problem hiding this comment.
How about "Expression Tree"? We hide tree expression builder in implementation. So it's better that we also hide it in document.
There was a problem hiding this comment.
That makes sense. I've changed it.
c_glib/gandiva-glib/expression.cpp
Outdated
| * @input_fields: (element-type GArrowField): The input fields. | ||
| * @output_field: A #GArrowField to be output. | ||
| * @node: The node in the expression tree. | ||
| * @field: A #GArrowField to be output. |
There was a problem hiding this comment.
Can you use root_node and result_field here?
Parameter name is important to describe parameter value.
c_glib/gandiva-glib/expression.cpp
Outdated
| arrow_input_fields, | ||
| arrow_output_field); | ||
| gandiva::TreeExprBuilder::MakeExpression(gandiva_node, | ||
| arrow_field); |
There was a problem hiding this comment.
We need to keep a reference to GArrowField.
See f36ad38 how to implement it.
There was a problem hiding this comment.
I've implemented it.
There was a problem hiding this comment.
And I’ve implemented to keep a reference to GGandivaNode.
Please review again.
|
|
||
| #define GGANDIVA_NODE_GET_PRIVATE(object) \ | ||
| static_cast<GGandivaNodePrivate *>( \ | ||
| ggandiva_node_get_instance_private( \ |
kou
left a comment
There was a problem hiding this comment.
We need more name changes.
Can you check my comments?
c_glib/gandiva-glib/expression.cpp
Outdated
| PROP_EXPRESSION | ||
| PROP_EXPRESSION = 1, | ||
| PROP_NODE, | ||
| PROP_FIELD |
There was a problem hiding this comment.
root_node and return_field are better like the constructor parameter names.
There was a problem hiding this comment.
I've changed it to use PROP_ROOT_NODE and PROP_RESULT_FIELD.
c_glib/gandiva-glib/expression.cpp
Outdated
| * @function: The function name in the expression. | ||
| * @input_fields: (element-type GArrowField): The input fields. | ||
| * @output_field: A #GArrowField to be output. | ||
| * @root_node: The node in the expression tree. |
There was a problem hiding this comment.
"The root node for the expression." may be better.
c_glib/gandiva-glib/expression.cpp
Outdated
| * @input_fields: (element-type GArrowField): The input fields. | ||
| * @output_field: A #GArrowField to be output. | ||
| * @root_node: The node in the expression tree. | ||
| * @result_field: A #GArrowField to be output. |
There was a problem hiding this comment.
"The name and type of returned value as #GArrowField." may be better.
c_glib/gandiva-glib/expression.cpp
Outdated
| * | ||
| * Returns: (transfer full): The expression tree with a root node, | ||
| * Returns: The expression tree with a root node, | ||
| * and a result field. |
There was a problem hiding this comment.
We can use simply "A newly created #GGandivaExpression" here.
c_glib/gandiva-glib/expression.cpp
Outdated
| arrow_input_fields.push_back(arrow_input_field); | ||
| } | ||
| auto arrow_output_field = garrow_field_get_raw(output_field); | ||
| auto gandiva_node = ggandiva_node_get_raw(root_node); |
c_glib/gandiva-glib/expression.cpp
Outdated
| } | ||
| auto arrow_output_field = garrow_field_get_raw(output_field); | ||
| auto gandiva_node = ggandiva_node_get_raw(root_node); | ||
| auto arrow_field = garrow_field_get_raw(result_field); |
c_glib/gandiva-glib/expression.cpp
Outdated
| GGandivaExpression * | ||
| ggandiva_expression_new_raw(std::shared_ptr<gandiva::Expression> *gandiva_expression) | ||
| ggandiva_expression_new_raw(std::shared_ptr<gandiva::Expression> *gandiva_expression, | ||
| GGandivaNode *node, |
c_glib/gandiva-glib/expression.cpp
Outdated
| ggandiva_expression_new_raw(std::shared_ptr<gandiva::Expression> *gandiva_expression) | ||
| ggandiva_expression_new_raw(std::shared_ptr<gandiva::Expression> *gandiva_expression, | ||
| GGandivaNode *node, | ||
| GArrowField *field) |
c_glib/gandiva-glib/expression.h
Outdated
| GList *input_fields, | ||
| GArrowField *output_field); | ||
| GGandivaExpression *ggandiva_expression_new(GGandivaNode *node, | ||
| GArrowField *field); |
There was a problem hiding this comment.
We need to change here too: root_node and return_field.
|
Oh... Thanks for your comments. |
|
I think I've addressed them. |
This PR adds Node classes to create
GGandivaExpressionwith the specifiedGGandivaNode.