Github user ajantha-bhat commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2792#discussion_r228128521
--- Diff: store/CSDK/src/CarbonReader.cpp ---
@@ -79,21 +78,19 @@ jobject CarbonReader::build() {
jmethodID buildID = jniEnv->GetMethodID(carbonReaderBuilderClass,
"build",
"()Lorg/apache/carbondata/sdk/file/CarbonReader;");
carbonReaderObject =
jniEnv->CallObjectMethod(carbonReaderBuilderObject, buildID);
+ jclass carbonReader = jniEnv->GetObjectClass(carbonReaderObject);
+ hasNextID = jniEnv->GetMethodID(carbonReader, "hasNext", "()Z");
--- End diff --
please move this hasNextID to CarbonReader::hasNext().
if not null then only assign (only one time assignment)
Also same comment for readNextRowID.
---