Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions include/LightGBM/arrow.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#ifndef LIGHTGBM_INCLUDE_LIGHTGBM_ARROW_H_
#define LIGHTGBM_INCLUDE_LIGHTGBM_ARROW_H_

#ifdef __cplusplus
#include <algorithm>
#include <cstdint>
#include <functional>
Expand All @@ -17,6 +18,7 @@
#include <utility>
#include <vector>
#include <stdexcept>
#endif

/* -------------------------------------- C DATA INTERFACE ------------------------------------- */
// The C data interface is taken from
Expand Down Expand Up @@ -72,6 +74,7 @@ struct ArrowArray {
/* CHUNKED ARRAY */
/* --------------------------------------------------------------------------------------------- */

#ifdef __cplusplus
namespace LightGBM {

/**
Expand Down Expand Up @@ -295,5 +298,6 @@ class ArrowTable {
} // namespace LightGBM

#include "arrow.tpp"
#endif /* __cplusplus */

#endif // LIGHTGBM_INCLUDE_LIGHTGBM_ARROW_H_
12 changes: 6 additions & 6 deletions include/LightGBM/c_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,8 @@ LIGHTGBM_C_EXPORT int LGBM_DatasetCreateFromMats(int32_t nmat,
* \return 0 when succeed, -1 when failure happens
*/
LIGHTGBM_C_EXPORT int LGBM_DatasetCreateFromArrow(int64_t n_chunks,
const ArrowArray* chunks,
const ArrowSchema* schema,
const struct ArrowArray* chunks,
const struct ArrowSchema* schema,
const char* parameters,
const DatasetHandle reference,
DatasetHandle *out);
Expand Down Expand Up @@ -571,8 +571,8 @@ LIGHTGBM_C_EXPORT int LGBM_DatasetSetField(DatasetHandle handle,
LIGHTGBM_C_EXPORT int LGBM_DatasetSetFieldFromArrow(DatasetHandle handle,
const char* field_name,
int64_t n_chunks,
const ArrowArray* chunks,
const ArrowSchema* schema);
const struct ArrowArray* chunks,
const struct ArrowSchema* schema);

/*!
* \brief Get info vector from dataset.
Expand Down Expand Up @@ -1450,8 +1450,8 @@ LIGHTGBM_C_EXPORT int LGBM_BoosterPredictForMats(BoosterHandle handle,
*/
LIGHTGBM_C_EXPORT int LGBM_BoosterPredictForArrow(BoosterHandle handle,
int64_t n_chunks,
const ArrowArray* chunks,
const ArrowSchema* schema,
const struct ArrowArray* chunks,
const struct ArrowSchema* schema,
int predict_type,
int start_iteration,
int num_iteration,
Expand Down
12 changes: 6 additions & 6 deletions src/c_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1643,8 +1643,8 @@ int LGBM_DatasetCreateFromCSC(const void* col_ptr,
}

int LGBM_DatasetCreateFromArrow(int64_t n_chunks,
const ArrowArray* chunks,
const ArrowSchema* schema,
const struct ArrowArray* chunks,
const struct ArrowSchema* schema,
const char* parameters,
const DatasetHandle reference,
DatasetHandle *out) {
Expand Down Expand Up @@ -1858,8 +1858,8 @@ int LGBM_DatasetSetField(DatasetHandle handle,
int LGBM_DatasetSetFieldFromArrow(DatasetHandle handle,
const char* field_name,
int64_t n_chunks,
const ArrowArray* chunks,
const ArrowSchema* schema) {
const struct ArrowArray* chunks,
const struct ArrowSchema* schema) {
API_BEGIN();
auto dataset = reinterpret_cast<Dataset*>(handle);
ArrowChunkedArray ca(n_chunks, chunks, schema);
Expand Down Expand Up @@ -2617,8 +2617,8 @@ int LGBM_BoosterPredictForMats(BoosterHandle handle,

int LGBM_BoosterPredictForArrow(BoosterHandle handle,
int64_t n_chunks,
const ArrowArray* chunks,
const ArrowSchema* schema,
const struct ArrowArray* chunks,
const struct ArrowSchema* schema,
int predict_type,
int start_iteration,
int num_iteration,
Expand Down
Loading