Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
acezen committed Aug 29, 2023
1 parent 16e78c0 commit 0c6f5bd
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 17 deletions.
11 changes: 3 additions & 8 deletions cpp/include/gar/util/expression.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,15 @@ limitations under the License.
#include <memory>
#include <string>

#include "arrow/compute/api.h"

#include "gar/graph_info.h"

#ifndef GAR_UTIL_EXPRESSION_H_
#define GAR_UTIL_EXPRESSION_H_

namespace GAR_NAMESPACE_INTERNAL {

// forward declarations
namespace arrow {
namespace compute {
class Expression;
}
} // namespace arrow

using ArrowExpression = arrow::compute::Expression;

/**
Expand Down Expand Up @@ -90,7 +85,7 @@ class ExpressionLiteral : public Expression {
ExpressionLiteral(const ExpressionLiteral& other) = default;
~ExpressionLiteral() = default;

Result<ArrowExpression> Evaluate();
Result<ArrowExpression> Evaluate() { return arrow::compute::literal(value_); }

private:
T value_;
Expand Down
3 changes: 2 additions & 1 deletion cpp/include/gar/util/reader_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ limitations under the License.
#include <vector>

#include "gar/graph_info.h"
#include "gar/util/expression.h"

namespace GAR_NAMESPACE_INTERNAL {

class Expression;

namespace util {

using Filter = std::shared_ptr<Expression>;
Expand Down
8 changes: 0 additions & 8 deletions cpp/src/expression.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,10 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

#include "arrow/compute/api.h"

#include "gar/util/expression.h"

namespace GAR_NAMESPACE_INTERNAL {

template <typename T, typename enabler>
ExpressionLiteral<T, Enabler>::Evaluate() {
return arrow::compute::literal(value_);
}

Result<ArrowExpression> ExpressionProperty::Evaluate() {
return arrow::compute::field_ref(property_.name);
}
Expand Down
1 change: 1 addition & 0 deletions cpp/src/reader_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ limitations under the License.
#include "parquet/arrow/reader.h"

#include "gar/graph_info.h"
#include "gar/util/expression.h"
#include "gar/util/filesystem.h"
#include "gar/util/reader_util.h"

Expand Down

0 comments on commit 0c6f5bd

Please sign in to comment.