Tabnine Logo
ATypeTag
Code IndexAdd Tabnine to your IDE (free)

How to use
ATypeTag
in
org.apache.asterix.om.types

Best Java code snippets using org.apache.asterix.om.types.ATypeTag (Showing top 20 results out of 315)

origin: apache/asterixdb

public static int getStartSize(byte[] data, int start) {
  if (getIntervalTimeType(data, start) == ATypeTag.DATETIME.serialize()) {
    return Long.BYTES;
  } else {
    return Integer.BYTES;
  }
}
origin: apache/asterixdb

private boolean hasDerivedType(IAType[] types) {
  for (IAType type : types) {
    if (type.getTypeTag().isDerivedType()) {
      return true;
    }
  }
  return false;
}
origin: apache/asterixdb

public static IAType getDefaultOpenFieldType(ATypeTag tag) {
  if (tag.equals(ATypeTag.OBJECT))
    return NESTED_OPEN_RECORD_TYPE;
  if (tag.equals(ATypeTag.ARRAY))
    return NESTED_OPEN_AORDERED_LIST_TYPE;
  if (tag.equals(ATypeTag.MULTISET))
    return NESTED_OPEN_AUNORDERED_LIST_TYPE;
  else
    return null;
}
origin: apache/asterixdb

  aggType = typeTag;
} else if (typeTag != ATypeTag.SYSTEM_NULL && !ATypeHierarchy.isCompatible(typeTag, aggType)) {
  if (typeTag.ordinal() > aggType.ordinal()) {
    throw new IncompatibleTypeException(sourceLoc, BuiltinFunctions.AVG, data[offset], aggType.serialize());
  } else {
    throw new IncompatibleTypeException(sourceLoc, BuiltinFunctions.AVG, aggType.serialize(), data[offset]);
origin: apache/asterixdb

if (fieldValueType.getTypeTag().equals(ATypeTag.UNION)) {
  if (((AUnionType) fieldValueType).isUnknownableType()) {
    fieldValueTypeTag = ((AUnionType) fieldValueType).getActualType().getTypeTag();
    fieldValueLength = NonTaggedFormatUtil.getFieldValueLength(serRecord, fieldValueOffset,
        fieldValueTypeTag, false);
    out.writeByte(fieldValueTypeTag.serialize());
  } else {
  fieldValueLength = NonTaggedFormatUtil.getFieldValueLength(serRecord, fieldValueOffset,
      fieldValueTypeTag, false);
  out.writeByte(fieldValueTypeTag.serialize());
origin: apache/asterixdb

  return;
if (oldValueType.isDerivedType()) {
  throw new TypeMismatchException(sourceLoc, BuiltinFunctions.RECORD_REPLACE, 1, oldValueType.serialize(),
      "primitive");
if (newValueType.isDerivedType()) {
  newValueRecordCaster.evaluate(tuple, newValuePointable);
origin: apache/asterixdb

if (ATYPETAGDESERIALIZER.deserialize(valueBytes[valueOffset]).isDerivedType()) {
  throw new RuntimeDataException(ErrorCode.CANNOT_COMPARE_COMPLEX, sourceLocation);
if (!ATYPETAGDESERIALIZER.deserialize(listBytes[listOffset]).isListType()) {
  PointableHelper.setNull(result);
  return;
origin: apache/asterixdb

if (typeTag == null)
  return flatValueAllocator.allocate(null);
else if (typeTag.equals(ATypeTag.OBJECT))
  return recordValueAllocator.allocate(DefaultOpenFieldType.NESTED_OPEN_RECORD_TYPE);
else if (typeTag.equals(ATypeTag.MULTISET)) {
  ATypeTag listItemType = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(b[offset]);
  if (listItemType == ATypeTag.ANY)
    return listValueAllocator.allocate(DefaultOpenFieldType.NESTED_OPEN_AUNORDERED_LIST_TYPE);
  else {
    if (listItemType.isDerivedType())
      return allocateFieldValue(listItemType, b, offset + 1);
    else
          unorederedListTypeAllocator.allocate(TypeTagUtil.getBuiltinTypeByTag(listItemType)));
} else if (typeTag.equals(ATypeTag.ARRAY)) {
  ATypeTag listItemType = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(b[offset]);
  if (listItemType == ATypeTag.ANY)
    return listValueAllocator.allocate(DefaultOpenFieldType.NESTED_OPEN_AORDERED_LIST_TYPE);
  else {
    if (listItemType.isDerivedType())
      return allocateFieldValue(listItemType, b, offset + 1);
    else
origin: apache/asterixdb

@Override
protected ATypeTag getNumericResultType(ATypeTag argTypeMax) {
  return argTypeMax.ordinal() < ATypeTag.FLOAT.ordinal() ? ATypeTag.DOUBLE : argTypeMax;
}
origin: apache/asterixdb

  @Override
  protected IAType getResultType(ILogicalExpression expr, IAType... strippedInputTypes) throws AlgebricksException {
    IAType type = strippedInputTypes[0];
    if (type.getTypeTag().isListType()) {
      return AUnionType.createNullableType(((AbstractCollectionType) type).getItemType());
    }
    return BuiltinType.ANY;
  }
}
origin: apache/asterixdb

  @Override
  public String getConstructor() {
    return getTypeTag().toString().toLowerCase();
  }
}
origin: apache/asterixdb

@Override
public IScalarEvaluatorFactory[] next() {
  IScalarEvaluatorFactory[] scalarEvaluatorFactories = new IScalarEvaluatorFactory[argSize];
  for (int j = 0; j < argSize; ++j) {
    int base = (int) Math.pow(ATypeTag.values().length, j);
    // Enumerates through all possible type tags.
    byte serializedTypeTag = (byte) ((index / base) % ATypeTag.values().length);
    scalarEvaluatorFactories[j] = new ConstantEvalFactory(new byte[] { serializedTypeTag });
  }
  ++index;
  return scalarEvaluatorFactories;
}
origin: apache/asterixdb

@Override
public String toString() {
  return this.name().toLowerCase();
}
origin: apache/asterixdb

@Override
public int hashCode() {
  int result = indicator;
  result = 31 * result + fieldName.hashCode();
  result = 31 * result + fieldType.hashCode();
  return result;
}
origin: apache/asterixdb

  aggType = typeTag;
} else if (typeTag != ATypeTag.SYSTEM_NULL && !ATypeHierarchy.isCompatible(typeTag, aggType)) {
  if (typeTag.ordinal() > aggType.ordinal()) {
    throw new IncompatibleTypeException(sourceLoc, BuiltinFunctions.AVG, bytes[offset],
        aggType.serialize());
  } else {
    throw new IncompatibleTypeException(sourceLoc, BuiltinFunctions.AVG, aggType.serialize(),
        bytes[offset]);
state[start + AGG_TYPE_OFFSET] = aggType.serialize();
origin: apache/asterixdb

  if (subType.getTypeTag().equals(ATypeTag.UNION)) {
    byte serializedTypeTag = subType.getTypeTag().serialize();
    if (serializedTypeTag != ATypeTag.SERIALIZED_RECORD_TYPE_TAG) {
      throw new TypeMismatchException(sourceLoc, serializedTypeTag,
  if (subType.getTypeTag().equals(ATypeTag.UNION)) {
    subTypeTag = ((AUnionType) subType).getActualType().getTypeTag();
    subFieldLength = NonTaggedFormatUtil.getFieldValueLength(serRecord, subFieldOffset,
    subRecordTmpStream.write(subTypeTag.serialize());
    subRecordTmpStream.write(serRecord, subFieldOffset, subFieldLength);
    serRecord = subRecordTmpStream.getByteArray();
  result.set(serRecord, subFieldOffset, subFieldLength);
} else {
  out.writeByte(subTypeTag.serialize());
  out.write(serRecord, subFieldOffset, subFieldLength);
  result.set(resultStorage);
origin: apache/asterixdb

if (!listType.isListType() || Math.floor(maxDouble) < maxDouble || targetTag == ATypeTag.NULL
    || Double.isInfinite(maxDouble) || Double.isNaN(maxDouble)) {
  PointableHelper.setNull(result);
if (targetTag.isDerivedType()) {
  throw new RuntimeDataException(ErrorCode.CANNOT_COMPARE_COMPLEX, sourceLoc);
origin: apache/asterixdb

public static boolean canPromote(ATypeTag type1, ATypeTag type2) {
  return typePromotionHierachyMap.get(type1.ordinal() * ATypeTag.TYPE_COUNT + type2.ordinal());
}
origin: apache/asterixdb

@Override
protected IAType getResultType(ILogicalExpression expr, IAType... strippedInputTypes) throws AlgebricksException {
  IAType argType = strippedInputTypes[0];
  IAType outputType = resultType;
  if (!argType.getTypeTag().isListType() || isUnknownable(((AbstractCollectionType) argType).getItemType())) {
    outputType = AUnionType.createUnknownableType(outputType);
  }
  return outputType;
}
origin: apache/asterixdb

@Override
public String toString() {
  return getTypeTag().toString();
}
org.apache.asterix.om.typesATypeTag

Javadoc

There is a unique tag for each primitive type and for each kind of non-primitive type in the object model

Most used methods

  • serialize
  • isDerivedType
  • equals
  • ordinal
  • isListType
  • toString
  • hashCode
  • name
  • values

Popular in Java

  • Reading from database using SQL prepared statement
  • setContentView (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now