Пример #1
0
            public WriterOptions(Properties tableProperties, Configuration conf)
            {
                configuration = conf;
                memoryManagerValue = getMemoryManager(conf);
                stripeSizeValue = OrcConf.STRIPE_SIZE.getLong(tableProperties, conf);
                blockSizeValue = OrcConf.BLOCK_SIZE.getLong(tableProperties, conf);
                rowIndexStrideValue =
                    (int)OrcConf.ROW_INDEX_STRIDE.getLong(tableProperties, conf);
                bufferSizeValue = (int)OrcConf.BUFFER_SIZE.getLong(tableProperties,
                    conf);
                blockPaddingValue =
                    OrcConf.BLOCK_PADDING.getBoolean(tableProperties, conf);
                compressValue = (CompressionKind)Enum.Parse(
                    typeof(CompressionKind),
                    OrcConf.COMPRESS.getString(tableProperties, conf),
                    true);
                string versionName = OrcConf.WRITE_FORMAT.getString(tableProperties,
                    conf);
                versionValue = VersionHelper.byName(versionName);
                string enString = OrcConf.ENCODING_STRATEGY.getString(tableProperties,
                    conf);
                _encodingStrategy = (EncodingStrategy)Enum.Parse(typeof(EncodingStrategy), enString, true);

                string compString =
                    OrcConf.COMPRESSION_STRATEGY.getString(tableProperties, conf);
                compressionStrategy = (CompressionStrategy)Enum.Parse(typeof(CompressionStrategy), compString, true);

                _paddingTolerance =
                    OrcConf.BLOCK_PADDING_TOLERANCE.getDouble(tableProperties, conf);

                _bloomFilterColumns = OrcConf.BLOOM_FILTER_COLUMNS.getString(tableProperties,
                    conf);
                _bloomFilterFpp = OrcConf.BLOOM_FILTER_FPP.getDouble(tableProperties,
                    conf);
                timeZone = TimeZoneInfo.Local.Id;
            }
Пример #2
0
 public static long getLong(this OrcConf orcConf, Properties tbl, Configuration conf)
 {
     return OrcConfDetails.details[(int)orcConf].getLong(tbl, conf);
 }
Пример #3
0
 /**
  * Create a set of write options based on a set of table properties and
  * configuration.
  * @param tableProperties the properties of the table
  * @param conf the configuration of the query
  * @return a WriterOptions object that can be modified
  */
 public static WriterOptions writerOptions(Properties tableProperties, Configuration conf)
 {
     return new WriterOptions(tableProperties, conf);
 }
Пример #4
0
 public static bool getBoolean(this OrcConf orcConf, Properties tbl, Configuration conf)
 {
     return OrcConfDetails.details[(int)orcConf].getBoolean(tbl, conf);
 }
Пример #5
0
 public static double getDouble(this OrcConf orcConf, Properties tbl, Configuration conf)
 {
     return OrcConfDetails.details[(int)orcConf].getDouble(tbl, conf);
 }
Пример #6
0
 private string lookupValue(Properties tbl, Configuration conf)
 {
     string result = null;
     if (tbl != null)
     {
         result = tbl.getProperty(attribute);
     }
     if (result == null && conf != null)
     {
         result = conf.get(attribute);
         if (result == null)
         {
             result = conf.get(hiveConfName);
         }
     }
     return result;
 }
Пример #7
0
 public string getString(Properties tbl, Configuration conf)
 {
     string value = lookupValue(tbl, conf);
     return value == null ? (String)defaultValue : value;
 }
Пример #8
0
 public long getLong(Properties tbl, Configuration conf)
 {
     string value = lookupValue(tbl, conf);
     if (value != null)
     {
         return Int64.Parse(value);
     }
     return ((IConvertible)defaultValue).ToInt64(CultureInfo.InvariantCulture);
 }
Пример #9
0
 public double getDouble(Properties tbl, Configuration conf)
 {
     string value = lookupValue(tbl, conf);
     if (value != null)
     {
         return Double.Parse(value);
     }
     return ((IConvertible)defaultValue).ToDouble(CultureInfo.InvariantCulture);
 }
Пример #10
0
 public bool getBoolean(Properties tbl, Configuration conf)
 {
     string value = lookupValue(tbl, conf);
     if (value != null)
     {
         return Boolean.Parse(value);
     }
     return (bool)defaultValue;
 }