Skip to content

Commit

Permalink
add stuff. 100 rows
Browse files Browse the repository at this point in the history
  • Loading branch information
lriggs committed Sep 8, 2023
1 parent eff685a commit fafb35a
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 5 deletions.
33 changes: 33 additions & 0 deletions build_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
rm -rf cpp-jni java-dist java-jni cpp/debug
mkdir cpp/debug
cd cpp/debug

arch -x86_64 cmake -DCMAKE_BUILD_TYPE=RELEASE -DARROW_GANDIVA=ON -DARROW_JEMALLOC=OFF -DARROW_GANDIVA_JAVA=ON -DARROW_BUILD_TESTS=OFF ..
arch -x86_64 make -j 8
if [ $? -ne 0 ]
then
echo "failed"
exit 1
fi

cd ../../
mkdir -p java-jni cpp-jni

arch -x86_64 cmake -S cpp -B cpp-jni -DARROW_BUILD_SHARED=OFF -DARROW_JEMALLOC=OFF -DARROW_CSV=ON -DARROW_DATASET=ON -DARROW_DEPENDENCY_SOURCE=BUNDLED -DARROW_DEPENDENCY_USE_SHARED=OFF -DARROW_FILESYSTEM=ON -DARROW_GANDIVA=ON -DARROW_GANDIVA_STATIC_LIBSTDCPP=ON -DARROW_ORC=ON -DARROW_PARQUET=ON -DARROW_S3=ON -DARROW_USE_CCACHE=ON -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_LIBDIR=lib/x86_64 -DCMAKE_INSTALL_PREFIX=java-dist -DCMAKE_UNITY_BUILD=ON
arch -x86_64 cmake --build cpp-jni --target install --config Release
if [ $? -ne 0 ]
then
echo "failed"
exit 1
fi

arch -x86_64 cmake -S java -B java-jni -DARROW_JAVA_JNI_ENABLE_C=OFF -DARROW_JEMALLOC=OFF -DARROW_JAVA_JNI_ENABLE_DEFAULT=ON -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_LIBDIR=lib/x86_64 -DCMAKE_INSTALL_PREFIX=java-dist -DCMAKE_PREFIX_PATH=$PWD/java-dist/lib/x86_64/cmake
arch -x86_64 cmake --build java-jni --target install --config Release
if [ $? -ne 0 ]
then
echo "failed"
exit 1
fi

cd java
/opt/homebrew/bin/mvn -DskipTests -Darrow.c.jni.dist.dir=/Users/logan.riggs/github/arrow-fork/arrow/java-dist/lib -Darrow.cpp.build.dir=/Users/logan.riggs/github/arrow-fork/arrow/java-dist/lib -Parrow-jni clean install
37 changes: 37 additions & 0 deletions build_testing.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
rm -rf cpp-jni java-dist java-jni cpp/debug
mkdir cpp/debug
cd cpp/debug

echo "====CPP===="
arch -x86_64 cmake -DCMAKE_BUILD_TYPE=DEBUG -DARROW_GANDIVA=ON -DARROW_JEMALLOC=OFF -DARROW_GANDIVA_JAVA=ON -DARROW_BUILD_TESTS=ON ..
arch -x86_64 make -j 8
if [ $? -ne 0 ]
then
echo "failed"
exit 1
fi

cd ../../
mkdir -p java-jni cpp-jni

echo "====CPP-JNI===="
arch -x86_64 cmake -S cpp -B cpp-jni -DARROW_BUILD_SHARED=OFF -DARROW_JEMALLOC=OFF -DARROW_CSV=ON -DARROW_DATASET=ON -DARROW_DEPENDENCY_SOURCE=BUNDLED -DARROW_DEPENDENCY_USE_SHARED=OFF -DARROW_FILESYSTEM=ON -DARROW_GANDIVA=ON -DARROW_GANDIVA_STATIC_LIBSTDCPP=ON -DARROW_ORC=ON -DARROW_PARQUET=ON -DARROW_S3=ON -DARROW_USE_CCACHE=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_LIBDIR=lib/x86_64 -DCMAKE_INSTALL_PREFIX=java-dist -DCMAKE_UNITY_BUILD=ON
arch -x86_64 cmake --build cpp-jni --target install --config Debug
if [ $? -ne 0 ]
then
echo "failed"
exit 1
fi

echo "====JAVA-JNI===="
arch -x86_64 cmake -S java -B java-jni -DARROW_JAVA_JNI_ENABLE_C=OFF -DARROW_JEMALLOC=OFF -DARROW_JAVA_JNI_ENABLE_DEFAULT=ON -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_LIBDIR=lib/x86_64 -DCMAKE_INSTALL_PREFIX=java-dist -DCMAKE_PREFIX_PATH=$PWD/java-dist/lib/x86_64/cmake -DArrowTesting_DIR=$PWD/cpp/debug/src/arrow
arch -x86_64 cmake --build java-jni --target install --config Debug
if [ $? -ne 0 ]
then
echo "failed"
exit 1
fi

echo "====JARS===="
cd java
/opt/homebrew/bin/mvn -DskipTests -Darrow.c.jni.dist.dir=/Users/logan.riggs/github/arrow-fork/arrow/java-dist/lib -Darrow.cpp.build.dir=/Users/logan.riggs/github/arrow-fork/arrow/java-dist/lib -Parrow-jni clean install
3 changes: 1 addition & 2 deletions cpp/src/gandiva/engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@ Status Engine::FinalizeModule() {
if (!cached_) {
ARROW_RETURN_NOT_OK(RemoveUnusedFunctions());

/*
//LR Turning this off seems to provide better error messages with compilation/generation failures.
if (optimize_) {
// misc passes to allow for inlining, vectorization, ..
Expand All @@ -326,7 +325,7 @@ Status Engine::FinalizeModule() {
pass_builder.populateModulePassManager(*pass_manager);
pass_manager->run(*module_);
}
*/

ARROW_RETURN_IF(llvm::verifyModule(*module_, &llvm::errs()),
Status::CodeGenError("Module verification failed after optimizer"));
}
Expand Down
2 changes: 1 addition & 1 deletion java/gandiva/src/main/cpp/jni_common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,7 @@ Java_org_apache_arrow_gandiva_evaluator_JniWrapper_evaluateProjector(
<< (array_data->child_data[0])->length << std::endl;

//LRTest1 Start
int numRecords = 5;
int numRecords = 5 * 100;
//int numRecords = (array_data->child_data[0])->length * array_data->length;
int recordSize = numRecords * 4;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,14 +455,16 @@ private void evaluate(int numRows, List<ArrowBuf> buffers, List<ArrowBuffer> buf
if (valueVector instanceof ListVector) {
//LR HACK

int numRecordsFound = 5;
int numRecordsFound = 5 * 100;
//int numRecordsFound = Math.toIntExact(outSizes[3]) / 4;
logger.error("LR Projector.java using outsizes numRecords=" + numRecordsFound);

//ArrowBuf ab0 = new ArrowBuf(ReferenceManager.NO_OP, null, outSizes[2], outAddrs[2]);
ArrowBuf ab = new ArrowBuf(ReferenceManager.NO_OP, null, outSizes[2], outAddrs[2]);
ArrowBuf ab2 = new ArrowBuf(ReferenceManager.NO_OP, null, outSizes[3], outAddrs[3]);
List<ArrowBuf> outBufsNew = new ArrayList<ArrowBuf>();

//outBufsNew.add(ab0);
outBufsNew.add(ab);
outBufsNew.add(ab2);
ArrowFieldNode afn = new ArrowFieldNode(numRecordsFound, 0);
Expand All @@ -471,7 +473,7 @@ private void evaluate(int numRows, List<ArrowBuf> buffers, List<ArrowBuffer> buf
//byte[] valid = new byte[outsizes[2]];
//LR HACK
//for (int i = 0; i < outSizes[2]; i++) {
for (int i = 0; i < numRecordsFound * 10; i++) {
for (int i = 0; i < numRecordsFound; i++) {
BitVectorHelper.setBit(((ListVector) valueVector).getDataVector().getValidityBuffer(), i);
}
}
Expand Down

0 comments on commit fafb35a

Please sign in to comment.