default public TestResult testAssignment(String keyspace, ColumnSpecification receiver) { AbstractType<?> type = getExactTypeIfKnown(keyspace); return type == null ? TestResult.NOT_ASSIGNABLE : type.testAssignment(keyspace, receiver); }
private SelectorFactories(List<Selectable> selectables, List<AbstractType<?>> expectedTypes, CFMetaData cfm, List<ColumnDefinition> defs, VariableSpecifications boundNames) throws InvalidRequestException { factories = new ArrayList<>(selectables.size()); for (int i = 0; i < selectables.size(); i++) { Selectable selectable = selectables.get(i); AbstractType<?> expectedType = expectedTypes == null ? null : expectedTypes.get(i); Factory factory = selectable.newSelectorFactory(cfm, expectedType, defs, boundNames); containsWritetimeFactory |= factory.isWritetimeSelectorFactory(); containsTTLFactory |= factory.isTTLSelectorFactory(); if (factory.isAggregateSelectorFactory()) ++numberOfAggregateFactories; factories.add(factory); } }
private SelectorFactories(List<Selectable> selectables, List<AbstractType<?>> expectedTypes, CFMetaData cfm, List<ColumnDefinition> defs, VariableSpecifications boundNames) throws InvalidRequestException { factories = new ArrayList<>(selectables.size()); for (int i = 0; i < selectables.size(); i++) { Selectable selectable = selectables.get(i); AbstractType<?> expectedType = expectedTypes == null ? null : expectedTypes.get(i); Factory factory = selectable.newSelectorFactory(cfm, expectedType, defs, boundNames); containsWritetimeFactory |= factory.isWritetimeSelectorFactory(); containsTTLFactory |= factory.isTTLSelectorFactory(); if (factory.isAggregateSelectorFactory()) ++numberOfAggregateFactories; factories.add(factory); } }
default public TestResult testAssignment(String keyspace, ColumnSpecification receiver) { AbstractType<?> type = getExactTypeIfKnown(keyspace); return type == null ? TestResult.NOT_ASSIGNABLE : type.testAssignment(keyspace, receiver); }
private SelectorFactories(List<Selectable> selectables, List<AbstractType<?>> expectedTypes, CFMetaData cfm, List<ColumnDefinition> defs, VariableSpecifications boundNames) throws InvalidRequestException { factories = new ArrayList<>(selectables.size()); for (int i = 0; i < selectables.size(); i++) { Selectable selectable = selectables.get(i); AbstractType<?> expectedType = expectedTypes == null ? null : expectedTypes.get(i); Factory factory = selectable.newSelectorFactory(cfm, expectedType, defs, boundNames); containsWritetimeFactory |= factory.isWritetimeSelectorFactory(); containsTTLFactory |= factory.isTTLSelectorFactory(); if (factory.isAggregateSelectorFactory()) ++numberOfAggregateFactories; factories.add(factory); } }
default public TestResult testAssignment(String keyspace, ColumnSpecification receiver) { AbstractType<?> type = getExactTypeIfKnown(keyspace); return type == null ? TestResult.NOT_ASSIGNABLE : type.testAssignment(keyspace, receiver); }
public Selector.Factory newSelectorFactory(CFMetaData cfm, AbstractType<?> expectedType, List<ColumnDefinition> defs, VariableSpecifications boundNames) { Selector.Factory factory = selected.newSelectorFactory(cfm, null, defs, boundNames); AbstractType<?> type = factory.getColumnSpecification(cfm).type; if (!type.isUDT()) { throw new InvalidRequestException( String.format("Invalid field selection: %s of type %s is not a user type", selected, type.asCQL3Type())); } UserType ut = (UserType) type; int fieldIndex = ut.fieldPosition(field); if (fieldIndex == -1) { throw new InvalidRequestException(String.format("%s of type %s has no field %s", selected, type.asCQL3Type(), field)); } return FieldSelector.newFactory(ut, fieldIndex, factory); }
default public TestResult testAssignment(String keyspace, ColumnSpecification receiver) { AbstractType<?> type = getExactTypeIfKnown(keyspace); return type == null ? TestResult.NOT_ASSIGNABLE : type.testAssignment(keyspace, receiver); }
public Selector.Factory newSelectorFactory(CFMetaData cfm, AbstractType<?> expectedType, List<ColumnDefinition> defs, VariableSpecifications boundNames) { Selector.Factory factory = selected.newSelectorFactory(cfm, null, defs, boundNames); AbstractType<?> type = factory.getColumnSpecification(cfm).type; if (!type.isUDT()) { throw new InvalidRequestException( String.format("Invalid field selection: %s of type %s is not a user type", selected, type.asCQL3Type())); } UserType ut = (UserType) type; int fieldIndex = ut.fieldPosition(field); if (fieldIndex == -1) { throw new InvalidRequestException(String.format("%s of type %s has no field %s", selected, type.asCQL3Type(), field)); } return FieldSelector.newFactory(ut, fieldIndex, factory); }
public AbstractType<?> getExactTypeIfKnown(String keyspace) { AbstractType<?> selectedType = selected.getExactTypeIfKnown(keyspace); if (selectedType == null || !(selectedType instanceof UserType)) return null; UserType ut = (UserType) selectedType; int fieldIndex = ut.fieldPosition(field); if (fieldIndex == -1) return null; return ut.fieldType(fieldIndex); }
public Selector.Factory newSelectorFactory(CFMetaData cfm, AbstractType<?> expectedType, List<ColumnDefinition> defs, VariableSpecifications boundNames) { Selector.Factory factory = selected.newSelectorFactory(cfm, null, defs, boundNames); AbstractType<?> type = factory.getColumnSpecification(cfm).type; if (!type.isUDT()) { throw new InvalidRequestException( String.format("Invalid field selection: %s of type %s is not a user type", selected, type.asCQL3Type())); } UserType ut = (UserType) type; int fieldIndex = ut.fieldPosition(field); if (fieldIndex == -1) { throw new InvalidRequestException(String.format("%s of type %s has no field %s", selected, type.asCQL3Type(), field)); } return FieldSelector.newFactory(ut, fieldIndex, factory); }
public AbstractType<?> getExactTypeIfKnown(String keyspace) { AbstractType<?> selectedType = selected.getExactTypeIfKnown(keyspace); if (selectedType == null || !(selectedType instanceof UserType)) return null; UserType ut = (UserType) selectedType; int fieldIndex = ut.fieldPosition(field); if (fieldIndex == -1) return null; return ut.fieldType(fieldIndex); }
public AbstractType<?> getExactTypeIfKnown(String keyspace) { AbstractType<?> selectedType = selected.getExactTypeIfKnown(keyspace); if (selectedType == null || !(selectedType instanceof UserType)) return null; UserType ut = (UserType) selectedType; int fieldIndex = ut.fieldPosition(field); if (fieldIndex == -1) return null; return ut.fieldType(fieldIndex); }
Selectable selectArg = arg.prepare(cfm); preparedArgs.add(selectArg); preparedTypes.add(selectArg.getExactTypeIfKnown(cfm.ksName));