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; }
public static long getLong(this OrcConf orcConf, Properties tbl, Configuration conf) { return OrcConfDetails.details[(int)orcConf].getLong(tbl, conf); }
/** * 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); }
public static bool getBoolean(this OrcConf orcConf, Properties tbl, Configuration conf) { return OrcConfDetails.details[(int)orcConf].getBoolean(tbl, conf); }
public static double getDouble(this OrcConf orcConf, Properties tbl, Configuration conf) { return OrcConfDetails.details[(int)orcConf].getDouble(tbl, conf); }
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; }
public string getString(Properties tbl, Configuration conf) { string value = lookupValue(tbl, conf); return value == null ? (String)defaultValue : value; }
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); }
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); }
public bool getBoolean(Properties tbl, Configuration conf) { string value = lookupValue(tbl, conf); if (value != null) { return Boolean.Parse(value); } return (bool)defaultValue; }