atlas-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Suma Shivaprasad <sumasai.shivapra...@gmail.com>
Subject Re: [Atlas] A source code question
Date Mon, 21 Sep 2015 15:45:54 GMT
attrname is same as i.name in this case. So shoudnt be an issue

Thanks
Suma

On Wed, Sep 16, 2015 at 1:20 PM, ltf <ltfxyz@163.com> wrote:

> Hello,
> In the following code, for ENUM, the key for fieldPos is i.name, but
> others are attrName.
> Is it a issue??? Thanks.
>
>
>
>
> file : org/apache/atlas/typesystem/types/HierarchicalType.java
> protected Pair<FieldMapping, ImmutableMap<String, String>>
> constructFieldMapping(ImmutableList<String> superTypes, AttributeInfo...
> fields) throws AtlasException { ... String attrName = i.name; if
> (fieldsMap.containsKey(attrName)) { attrName =
> currentPath.addOverrideAttr(attrName); } attributeNameToType.put(attrName,
> superType.getName()); fieldsMap.put(attrName, i);
> fieldNullPos.put(attrName, fieldNullPos.size()); if (i.dataType() ==
> DataTypes.BOOLEAN_TYPE) { fieldPos.put(attrName, numBools); numBools++; }
> else if (i.dataType() == DataTypes.BYTE_TYPE) { fieldPos.put(attrName,
> numBytes); numBytes++; } else if (i.dataType() == DataTypes.SHORT_TYPE) {
> fieldPos.put(attrName, numShorts); numShorts++; } else if (i.dataType() ==
> DataTypes.INT_TYPE) { fieldPos.put(attrName, numInts); numInts++; } else if
> (i.dataType() == DataTypes.LONG_TYPE) { fieldPos.put(attrName, numLongs);
> numLongs++; } else if (i.dataType() == DataTypes.FLOAT_TYPE) {
> fieldPos.put(attrName, numFloats); numFloats++; } else if (i.dataType() ==
> DataTypes.DOUBLE_TYPE) { fieldPos.put(attrName, numDoubles); numDoubles++;
> } else if (i.dataType() == DataTypes.BIGINTEGER_TYPE) {
> fieldPos.put(attrName, numBigInts); numBigInts++; } else if (i.dataType()
> == DataTypes.BIGDECIMAL_TYPE) { fieldPos.put(attrName, numBigDecimals);
> numBigDecimals++; } else if (i.dataType() == DataTypes.DATE_TYPE) {
> fieldPos.put(attrName, numDates); numDates++; } else if (i.dataType() ==
> DataTypes.STRING_TYPE) { fieldPos.put(attrName, numStrings); numStrings++;
> } else if (i.dataType().getTypeCategory() == DataTypes.TypeCategory.ENUM) {
> fieldPos.put(i.name, numInts); numInts++; } else if
> (i.dataType().getTypeCategory() == DataTypes.TypeCategory.ARRAY) {
> fieldPos.put(attrName, numArrays); numArrays++;
>
>
>
>
>
>
>
>
> Best, liutongfeng
>
>
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message