-
Notifications
You must be signed in to change notification settings - Fork 703
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CARBONDATA-3300] Fixed ClassNotFoundException when using UDF in spark-shell #3132
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,6 +100,7 @@ | |
import com.google.gson.GsonBuilder; | ||
import org.apache.commons.codec.binary.Base64; | ||
import org.apache.commons.io.FileUtils; | ||
import org.apache.commons.io.input.ClassLoaderObjectInputStream; | ||
import org.apache.commons.lang.ArrayUtils; | ||
import org.apache.commons.lang.StringUtils; | ||
import org.apache.commons.lang3.StringEscapeUtils; | ||
|
@@ -1536,7 +1537,8 @@ public static ValueEncoderMeta deserializeEncoderMetaV2(byte[] encoderMeta) { | |
ValueEncoderMeta meta = null; | ||
try { | ||
aos = new ByteArrayInputStream(encoderMeta); | ||
objStream = new ObjectInputStream(aos); | ||
objStream = | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "CarbonUtil.closeStreams(objStream);" cann't be called when not IOException There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no need for other exception handling because stream throw only ClassNotFoundException/IOException. |
||
new ClassLoaderObjectInputStream(Thread.currentThread().getContextClassLoader(), aos); | ||
meta = (ValueEncoderMeta) objStream.readObject(); | ||
} catch (ClassNotFoundException e) { | ||
LOGGER.error(e); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this method seems that "inputStream.close();" doesn't use finally block, can you add the protection in this pr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not open the file to mandatorily close the stream, it just opens on the byte[] so it is not needed to close in finally