Github user HyukjinKwon commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19055#discussion_r135686725
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala ---
    @@ -322,6 +322,15 @@ object SQLConf {
           .booleanConf
           .createWithDefault(true)
     
    +  // We can add LZO after Apache ORC 1.4.0 is used.
    +  val ORC_COMPRESSION = buildConf("spark.sql.orc.compression.codec")
    +    .doc("Sets the compression codec use when writing ORC files. 
Acceptable values include: " +
    +      "uncompressed, snappy, zlib.")
    +    .stringConf
    +    .transform(_.toLowerCase(Locale.ROOT))
    +    .checkValues(Set("none", "uncompressed", "snappy", "zlib"))
    --- End diff --
    
    @dongjoon-hyun, I think my only main concern is inconsistency between 
`compression` option and this config. If `lzo` is an unknown key and it 
directly throws an exception (or even this was not there in the first place), I 
would have been okay but it looks attempting to find:
    
    ```
    java.lang.IllegalArgumentException: LZO is not available.
        at 
org.apache.hadoop.hive.ql.io.orc.WriterImpl.createCodec(WriterImpl.java:331)
        at 
org.apache.hadoop.hive.ql.io.orc.WriterImpl.<init>(WriterImpl.java:201)
        at 
org.apache.hadoop.hive.ql.io.orc.OrcFile.createWriter(OrcFile.java:464)
        at 
org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat$OrcRecordWriter.write(OrcOutputFormat.java:74)
        at 
org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat$OrcRecordWriter.write(OrcOutputFormat.java:55)
           ...
    ```
    
    ```java
    ...
          case LZO:
            try {
              Class<? extends CompressionCodec> lzo =
                  (Class<? extends CompressionCodec>)
                      
JavaUtils.loadClass("org.apache.hadoop.hive.ql.io.orc.LzoCodec");
              return lzo.newInstance();
            } catch (ClassNotFoundException e) {
              throw new IllegalArgumentException("LZO is not available.", e);
            } catch (InstantiationException e) {
              throw new IllegalArgumentException("Problem initializing LZO", e);
            } catch (IllegalAccessException e) {
              throw new IllegalArgumentException("Insufficient access to LZO", 
e);
            }
    ...
    ```
    
    This appears that if we provide `org.apache.hadoop.hive.ql.io.orc.LzoCodec` 
anyhow in the classpath (as an extream case , the one implemented by an user, 
it should work, if I read this correctly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to