/usr/local/lib64/python3.6/site-packages/pyarrow/include/arrow/compute/exec
Edit: /usr/local/lib64/python3.6/site-packages/pyarrow/include/arrow/compute/exec/hash_join.h (4076B)
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, 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.
#pragma once
#include
#include
#include
#include "arrow/compute/exec/options.h"
#include "arrow/compute/exec/schema_util.h"
#include "arrow/compute/exec/task_util.h"
#include "arrow/result.h"
#include "arrow/status.h"
#include "arrow/type.h"
namespace arrow {
namespace compute {
class ARROW_EXPORT HashJoinSchema {
public:
Status Init(JoinType join_type, const Schema& left_schema,
const std::vector& left_keys, const Schema& right_schema,
const std::vector& right_keys,
const std::string& left_field_name_prefix,
const std::string& right_field_name_prefix);
Status Init(JoinType join_type, const Schema& left_schema,
const std::vector& left_keys,
const std::vector& left_output, const Schema& right_schema,
const std::vector& right_keys,
const std::vector& right_output,
const std::string& left_field_name_prefix,
const std::string& right_field_name_prefix);
static Status ValidateSchemas(JoinType join_type, const Schema& left_schema,
const std::vector& left_keys,
const std::vector& left_output,
const Schema& right_schema,
const std::vector& right_keys,
const std::vector& right_output,
const std::string& left_field_name_prefix,
const std::string& right_field_name_prefix);
std::shared_ptr MakeOutputSchema(const std::string& left_field_name_prefix,
const std::string& right_field_name_prefix);
static int kMissingField() {
return SchemaProjectionMaps::kMissingField;
}
SchemaProjectionMaps proj_maps[2];
private:
static bool IsTypeSupported(const DataType& type);
static Result> VectorDiff(const Schema& schema,
const std::vector& a,
const std::vector& b);
};
class HashJoinImpl {
public:
using OutputBatchCallback = std::function;
using FinishedCallback = std::function;
virtual ~HashJoinImpl() = default;
virtual Status Init(ExecContext* ctx, JoinType join_type, bool use_sync_execution,
size_t num_threads, HashJoinSchema* schema_mgr,
std::vector key_cmp,
OutputBatchCallback output_batch_callback,
FinishedCallback finished_callback,
TaskScheduler::ScheduleImpl schedule_task_callback) = 0;
virtual Status InputReceived(size_t thread_index, int side, ExecBatch batch) = 0;
virtual Status InputFinished(size_t thread_index, int side) = 0;
virtual void Abort(TaskScheduler::AbortContinuationImpl pos_abort_callback) = 0;
static Result> MakeBasic();
};
} // namespace compute
} // namespace arrow