Examples of lookupName()


Examples of com.linkedin.data.schema.SchemaParser.lookupName()

    final SchemaParser parser = new SchemaParser(resolver);

    final Class<? extends RecordTemplate> testClass = ClassNameFooRecord.class;
    final String nonExistSchemaName = "Non-Existing Schema";

    final DataSchema existSchema = parser.lookupName(testClass.getName());
    assertNotNull(existSchema);
    assertTrue(existSchema instanceof RecordDataSchema);
    assertEquals(((RecordDataSchema) existSchema).getFullName(), testClass.getCanonicalName());
    assertFalse(resolver.isBadLocation(new ClassNameDataSchemaLocation(testClass.getName())));
View Full Code Here

Examples of com.linkedin.data.schema.SchemaParser.lookupName()

    assertNotNull(existSchema);
    assertTrue(existSchema instanceof RecordDataSchema);
    assertEquals(((RecordDataSchema) existSchema).getFullName(), testClass.getCanonicalName());
    assertFalse(resolver.isBadLocation(new ClassNameDataSchemaLocation(testClass.getName())));

    final DataSchema nonExistSchema = parser.lookupName(nonExistSchemaName);
    assertNull(nonExistSchema);
    assertTrue(parser.errorMessage().contains(nonExistSchemaName));
    assertTrue(resolver.isBadLocation(new ClassNameDataSchemaLocation(nonExistSchemaName)));
  }
View Full Code Here

Examples of com.linkedin.data.schema.SchemaParser.lookupName()

    for (String[] entry : lookups)
    {
      String name = entry[0];
      String expectFound = entry[1];
      String expected = entry[2];
      DataSchema schema = parser.lookupName(name);
      if (debug) { out.println("----" + name + "-----"); }
      String errorMessage = parser.errorMessage();
      if (debug && errorMessage.isEmpty() == false) { out.println(errorMessage); }
      if (expectFound == ERROR)
      {
View Full Code Here

Examples of io.druid.segment.ColumnSelectorBitmapIndexSelector.lookupName()

                final DimensionSelector selector = entry.getValue();

                if (selector != null) {
                  final IndexedInts vals = selector.getRow();
                  for (int i = 0; i < vals.size(); ++i) {
                    final String dimVal = selector.lookupName(vals.get(i));
                    if (searchQuerySpec.accept(dimVal)) {
                      set.add(new SearchHit(entry.getKey(), dimVal));
                      if (set.size() >= limit) {
                        return set;
                      }
View Full Code Here

Examples of io.druid.segment.DimensionSelector.lookupName()

          vals[j] = theAggregators[j].get(resultsBuf, position);
          position += aggregatorSizes[j];
        }

        resultBuilder.addEntry(
            dimSelector.lookupName(i),
            i,
            vals
        );
      }
    }
View Full Code Here

Examples of io.druid.segment.DimensionSelector.lookupName()

      for (int i = 0; i < dimValues.size(); ++i) {
        final int dimIndex = dimValues.get(i);

        Aggregator[] theAggregators = rowSelector[dimIndex];
        if (theAggregators == null) {
          String key = query.getDimensionSpec().getDimExtractionFn().apply(dimSelector.lookupName(dimIndex));
          if (key == null) {
            rowSelector[dimIndex] = EMPTY_ARRAY;
            continue;
          }
          theAggregators = aggregatesStore.get(key);
View Full Code Here

Examples of io.druid.segment.DimensionSelector.lookupName()

      final DimensionSelector selector = selectorList.get(k);
      final IndexedInts row = selector.getRow();
      final int size = row.size();
      // nothing to add to hasher if size == 0, only handle size == 1 and size != 0 cases.
      if (size == 1) {
        final String value = selector.lookupName(row.get(0));
        hasher.putUnencodedChars(value != null ? value : NULL_STRING);
      } else if (size != 0) {
        final String[] values = new String[size];
        for (int i = 0; i < size; ++i) {
          final String value = selector.lookupName(row.get(i));
View Full Code Here

Examples of io.druid.segment.DimensionSelector.lookupName()

        final String value = selector.lookupName(row.get(0));
        hasher.putUnencodedChars(value != null ? value : NULL_STRING);
      } else if (size != 0) {
        final String[] values = new String[size];
        for (int i = 0; i < size; ++i) {
          final String value = selector.lookupName(row.get(i));
          values[i] = value != null ? value : NULL_STRING;
        }
        // Values need to be sorted to ensure consistent multi-value ordering across different segments
        Arrays.sort(values);
        for (int i = 0; i < size; ++i) {
View Full Code Here

Examples of io.druid.segment.DimensionSelector.lookupName()

    Cursor cursor = Sequences.toList(Sequences.limit(cursorSequence, 1), Lists.<Cursor>newArrayList()).get(0);
    DimensionSelector dimSelector;

    dimSelector = cursor.makeDimensionSelector("sally");
    Assert.assertEquals("bo", dimSelector.lookupName(dimSelector.getRow().get(0)));

    index.add(
        new MapBasedInputRow(
            t.minus(1).getMillis(),
            Lists.newArrayList("sally"),
View Full Code Here

Examples of io.druid.segment.DimensionSelector.lookupName()

    // Cursor reset should not be affected by out of order values
    cursor.reset();

    dimSelector = cursor.makeDimensionSelector("sally");
    Assert.assertEquals("bo", dimSelector.lookupName(dimSelector.getRow().get(0)));
  }

  @Test
  public void testSingleValueTopN()
  {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.