Module: Humboldt::TypeConverter
- Defined in:
- lib/humboldt/type_converters.rb
Defined Under Namespace
Classes: Binary, Long, None, Text
Constant Summary
collapse
- TYPE_CONVERTER_CLASS_CACHE =
Hash.new { |h,k| h[k] = const_get(k.to_s.capitalize) }
- FROM_HADOOP_MAPPINGS =
{
::Hadoop::Io::Text => Text,
::Hadoop::Io::BytesWritable => Binary,
::Hadoop::Io::LongWritable => Long,
::Hadoop::Io::NullWritable => None
}.freeze
Class Method Summary
collapse
Class Method Details
.from_hadoop(hadoop_class) ⇒ Object
73
74
75
76
77
|
# File 'lib/humboldt/type_converters.rb', line 73
def self.from_hadoop(hadoop_class)
accessor = FROM_HADOOP_MAPPINGS[hadoop_class]
raise ArgumentError, "Unsupported Hadoop type: #{hadoop_class}" unless accessor
accessor
end
|