Package com.foundationdb.server.collation

Examples of com.foundationdb.server.collation.AkCollator


        }

        private boolean eqP(ValueSource x, ValueSource y, TInstance type)
        {
            if (type.typeClass() instanceof TString) {
                AkCollator collator = TString.getCollator(type);
                if (collator != null) {
                    return collator.compare(x, y) == 0;
                }
            }
            return ValueSources.areEqual(x, y);
        }
View Full Code Here


            };
    }
   
    protected String checkFieldForMatch(IndexColumn field) {
        String fieldName = field.getColumn().getName();
        AkCollator collator = field.getColumn().getCollator();
        if ((collator != null) && !collator.isCaseSensitive()) {
            throw new AkibanInternalException("Building a term for field that may need analysis: " + fieldName);
        }
        return fieldName;
    }
View Full Code Here

        LikeType likeType = this.likeType;
        if (likeType == LikeType.LIKE)
        {
            CharacterTypeAttributes strAttrs = StringAttribute.characterTypeAttributes(context.inputTypeAt(0));
            CharacterTypeAttributes keyAttrs = StringAttribute.characterTypeAttributes(context.inputTypeAt(1));
            AkCollator collator = TString.mergeAkCollators(strAttrs, keyAttrs);
            if (collator != null)
            {
                likeType = collator.isCaseSensitive() ? LikeType.BLIKE : LikeType.ILIKE;
            }
        }
        context.set(TYPE_INDEX, likeType);
    }
View Full Code Here

    // Test ValueSourceHasher

    @Test
    public void testValueSourceHasher()
    {
        AkCollator caseInsensitiveCollator = AkCollatorFactory.getAkCollator("sv_se_ci");
        AkCollator binaryCollator = AkCollatorFactory.getAkCollator(AkCollatorFactory.UCS_BINARY);
        PersistitKeyValueSource source = new PersistitKeyValueSource(MString.VARCHAR.instance(true));
        long hash_AB;
        long hash_ab;
        Key key = store().createKey();
        {
            binaryCollator.append(key.clear(), "AB");
            source.attach(key, 0, MString.VARCHAR.instance(true));
            hash_AB = ValueSources.hash(source, binaryCollator);
            binaryCollator.append(key.clear(), "ab");
            source.attach(key, 0, MString.VARCHAR.instance(true));
            hash_ab = ValueSources.hash(source, binaryCollator);
            assertTrue(hash_AB != hash_ab);
        }
        {
View Full Code Here

                if (i > firstSpatialColumn) {
                    offset += index.dimensions() - 1;
                }
                Column column = index.getKeyColumns().get(firstColumn + offset).getColumn();
                type = column.getType();
                AkCollator collator = column.getCollator();
                useRawSegment = ((collator != null) && !collator.isRecoverable());
            }
            Object keyValue;
            if (useRawSegment) {
                keyValue = getRawSegment(key, i);
            }
View Full Code Here

                ValueSource columnValue = expression.resultValue();
                if (columnValue.isNull())
                    isNull = true;
                Value valueCopy = new Value(columnValue.getType());
                ValueTargets.copyFrom(columnValue, valueCopy);
                AkCollator collator = (collators != null) ? collators.get(i) : null;
                hashKey ^= ValueSources.hash(valueCopy, collator);
                values.add(valueCopy);
                i++;
            }
        }
View Full Code Here

            return StringFactory.NULL_CHARSET_ID;
        }
    }

    public String getCollationName() {
        AkCollator collator = getCollator();
        if (collator != null) {
            return collator.getScheme();
        }
        else {
            return null;
        }
    }
View Full Code Here

            break;
        case Types.CHAR:
        case Types.NVARCHAR:
        case Types.VARCHAR:
            {
                AkCollator collator = column.getCollator();
                if ((collator == null) || collator.isCaseSensitive()) {
                    fieldType = FieldType.STRING;
                }
                else {
                    fieldType = FieldType.TEXT;
                }
View Full Code Here

    @Override
    public boolean isCaseSensitive(int column) throws SQLException {
        Column aisColumn = getColumn(column).getAISColumn();
        if (aisColumn == null)
            return false;
        AkCollator collator = aisColumn.getCollator();
        if (collator == null)
            return false;
        else
            return collator.isCaseSensitive();
    }
View Full Code Here

                        else continue;
                        result.conditions.add(cond);
                        result.matchColumns.add(matchColumn);
                        result.hashColumns.add(hashColumn);
                        result.tKeyComparables.add(ccond.getKeyComparable());
                        AkCollator collator = null;
                        if (left.getType().hasAttributes(StringAttribute.class) &&
                            right.getType().hasAttributes(StringAttribute.class)) {
                            CharacterTypeAttributes leftAttributes = StringAttribute.characterTypeAttributes(left.getType());
                            CharacterTypeAttributes rightAttributes = StringAttribute.characterTypeAttributes(right.getType());
                            collator = TString.mergeAkCollators(leftAttributes, rightAttributes);
View Full Code Here

TOP

Related Classes of com.foundationdb.server.collation.AkCollator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.