fe/src/main/java/com/cloudera/impala/catalog/HdfsPartition.java
/*
   * Checks whether a file is supported in Impala based on the file extension.
   * Returns an empty string if the file format is supported, otherwise a string with
   * details on the incompatibility is returned.
   * Impala only supports .lzo on text files for partitions that have been declared in
   * the metastore as TEXT_LZO. For now, raise an error on any other type.
   */
Checks whether a file is supported in Impala based on the file extension.
Returns an empty string if the file format is supported, otherwise a string with
details on the incompatibility is returned.
Impala only supports .lzo on text files for partitions that have been declared in
the metastore as TEXT_LZO. For now, raise an error on any other type.
Checks whether a file is supported in Impala based on the file extension . Returns an empty string if the file format is supported otherwise a string with details on the incompatibility is returned . Impala only supports . lzo on text files for partitions that have been declared in the metastore as TEXT_LZO . For now raise an error on any other type .
public String checkFileCompressionTypeSupported(String fileName) {
    HdfsCompression compressionType = HdfsCompression.fromFileName(fileName);
    if (compressionType == HdfsCompression.LZO_INDEX) {
      return "";
    }
    HdfsStorageDescriptor sd = getInputFormatDescriptor();
    if (compressionType == HdfsCompression.LZO) {
      if (sd.getFileFormat() != HdfsFileFormat.LZO_TEXT) {
        return "Compressed file not supported without compression input format: " +
            fileName;
      }
    } else if (sd.getFileFormat() == HdfsFileFormat.LZO_TEXT) {
      return "Expected file with .lzo suffix: " + fileName;
    } else if (sd.getFileFormat() == HdfsFileFormat.TEXT
               && compressionType != HdfsCompression.NONE) {
      return "Compressed text files are not supported: " + fileName;
    }
    return "";
  }
public String checkFileCompressionTypeSupported ( String fileName ) { HdfsCompression compressionType = HdfsCompression . fromFileName ( fileName ) ; if ( compressionType == HdfsCompression . LZO_INDEX ) { return "" ; } HdfsStorageDescriptor sd = getInputFormatDescriptor ( ) ; if ( compressionType == HdfsCompression . LZO ) { if ( sd . getFileFormat ( ) != HdfsFileFormat . LZO_TEXT ) { return "Compressed file not supported without compression input format: " + fileName ; } } else if ( sd . getFileFormat ( ) == HdfsFileFormat . LZO_TEXT ) { return "Expected file with .lzo suffix: " + fileName ; } else if ( sd . getFileFormat ( ) == HdfsFileFormat . TEXT && compressionType != HdfsCompression . NONE ) { return "Compressed text files are not supported: " + fileName ; } return "" ; }
Checks whether a file is supported in Impala based on the file extension.
Checks whether a file is supported in Impala based on the file extension .
// Check to see if the file has a compression suffix. // Impala only supports .lzo on text files that have been declared in the metastore // as TEXT_LZO. For now, raise an error on any other type. // Index files are read by the LZO scanner directly.