Use the name field of {@link #schema} to partition path
516882
@Override
  protected String getPartitionedFileName(State properties, String originalFileName) {
    Schema schema = this.getSchema();
    if (schema != null) {
      return new Path(schema.getName(), originalFileName).toString();
    } else {
      return originalFileName;
    }
  }
1369075
@TimerJ
    public TableMetadataBuilder withPartitionKey(String... fields) {
        for (String field : fields) {
            partitionKey.add(new ColumnName(tableName, field));

        }

        return this;
    }
342933
private String getSchemaStringFromFile(File schemaFile) {
    String schemaString;
    FileInputStream fis = null;
    try {
      fis = new FileInputStream(schemaFile);
      schemaString = AvroUtils.inputStreamToString(fis);
    } catch (IOException e) {
      throw new DatasetException(e);
    } finally {
      if (fis != null) {
        try {
          fis.close();
        } catch (IOException e) {
        }
      }
    }
    return schemaString;
  }
171899
private String evaluateFieldPath(MappedFieldMetaData fieldMetaData) {
        ResourcePaths.ResourcePath path = fieldMetaData.getPath();
        return (path.hasPlaceholders() ? path.resolve(this.placeholderVariableResolvers::resolve) : path).getPath();
    }
617658
public String getValueSchema() throws IOException {
        Schema schema = getInputPathAvroSchema();
        String valueSchema = schema.getField(valueFieldName).schema().toString();
        return valueSchema;
    }
699488
def resolve_path(schema, fragment):
    
    fragment = fragment.lstrip('/')
    parts = unquote(fragment).split('/') if fragment else []
    for part in parts:
        part = part.replace('~1', '/').replace('~0', '~')
        if isinstance(schema, list):
            schema = schema[int(part)]
        elif part in schema:
            schema = schema[part]
        else:
            raise JsonSchemaException('Unresolvable ref: {}'.format(part))
    return schema
520579
protected Field convertFieldSchema(Schema inputSchema, Field field, WorkUnitState workUnit)
      throws SchemaConversionException {
    if (field.name().equals(payloadField)) {
      // Create a payload field with latest schema
      return createLatestPayloadField(field);
    }
    // Make a copy of the field to the output schema
    return new Field(field.name(), field.schema(), field.doc(), field.defaultValue(), field.order());
  }
937182
def _map_term_using_schema(master, path, term, schema_edges):
    
    output = FlatList()
    for k, v in term.items():
        dimension = schema_edges[k]
        if isinstance(dimension, Dimension):
            domain = dimension.getDomain()
            if dimension.fields:
                if is_data(dimension.fields):
                    # EXPECTING A TUPLE
                    for local_field, es_field in dimension.fields.items():
                        local_value = v[local_field]
                        if local_value == None:
                            output.append({"missing": {"field": es_field}})
                        else:
                            output.append({"term": {es_field: local_value}})
                    continue

                if len(dimension.fields) == 1 and is_variable_name(dimension.fields[0]):
                    # SIMPLE SINGLE-VALUED FIELD
                    if domain.getPartByKey(v) is domain.NULL:
                        output.append({"missing": {"field": dimension.fields[0]}})
                    else:
                        output.append({"term": {dimension.fields[0]: v}})
                    continue

                if AND(is_variable_name(f) for f in dimension.fields):
                    # EXPECTING A TUPLE
                    if not isinstance(v, tuple):
                        Log.error("expecing {{name}}={{value}} to be a tuple",  name= k,  value= v)
                    for i, f in enumerate(dimension.fields):
                        vv = v[i]
                        if vv == None:
                            output.append({"missing": {"field": f}})
                        else:
                            output.append({"term": {f: vv}})
                    continue
            if len(dimension.fields) == 1 and is_variable_name(dimension.fields[0]):
                if domain.getPartByKey(v) is domain.NULL:
                    output.append({"missing": {"field": dimension.fields[0]}})
                else:
                    output.append({"term": {dimension.fields[0]: v}})
                continue
            if domain.partitions:
                part = domain.getPartByKey(v)
                if part is domain.NULL or not part.esfilter:
                    Log.error("not expected to get NULL")
                output.append(part.esfilter)
                continue
            else:
                Log.error("not expected")
        elif is_data(v):
            sub = _map_term_using_schema(master, path + [k], v, schema_edges[k])
            output.append(sub)
            continue

        output.append({"term": {k: v}})
    return {"and": output}
252890
private Schema createAvroSchema(final Configuration configuration, final MetadataFilter filter) throws IOException {
    final ParquetMetadata footer = ParquetFileReader.readFooter(configuration, parquetFilePath, filter);
    final AvroSchemaConverter converter = new AvroSchemaConverter();
    final MessageType schema = footer.getFileMetaData().getSchema();
    return converter.convert(schema);
  }
1239580
static String defineFileName(SQLiteDatabaseSchema model) {
		int lastIndex = model.fileName.lastIndexOf(".");
		String schemaName = model.fileName;

		if (lastIndex > -1) {
			schemaName = model.fileName.substring(0, lastIndex);
		}

		schemaName = schemaName.toLowerCase() + "_schema_" + model.version + ".sql";

		return schemaName;
	}
393956
protected Schema getFieldSchema(GenericRecord record, String schemaIdLocation) throws Exception {
    Optional<Object> schemaIdValue = AvroUtils.getFieldValue(record, schemaIdLocation);
    if (!schemaIdValue.isPresent()) {
      throw new Exception("Schema id with key " + schemaIdLocation + " not found in the record");
    }
    String schemaKey = String.valueOf(schemaIdValue.get());
    return (Schema) registry.getSchemaByKey(schemaKey);
  }
279904
function extractPaths(schemaPaths, model) {
  return reduce(schemaPaths, (fields, schemaPath) => (
    merge(fields, extractPath(schemaPath, model))
  ), {});
}
164646
def _schema(self, path, obj, app):
        
        if path.startswith('#/definitions'):
            last_token = jp_split(path)[-1]
            if app.version == '1.2':
                obj.update_field('name', scope_split(last_token)[-1])
            else:
                obj.update_field('name', last_token)
185710
private void initSchemaPartition() throws Exception {
        final InstanceLayout instanceLayout = this.service.getInstanceLayout();

        final File schemaPartitionDirectory = new File(instanceLayout.getPartitionsDirectory(), "schema");

        /*
         * Extract the schema on disk (a brand new one) and load the registries
         */
        if (schemaPartitionDirectory.exists()) {
            System.out.println("schema partition already exists, skipping schema extraction");
        } else {
            final SchemaLdifExtractor extractor = new DefaultSchemaLdifExtractor(instanceLayout.getPartitionsDirectory());
            extractor.extractOrCopy();
        }

        final SchemaLoader loader = new LdifSchemaLoader(schemaPartitionDirectory);
        final SchemaManager schemaManager = new DefaultSchemaManager(loader);

        /*
         * We have to load the schema now, otherwise we won't be able
         * to initialize the Partitions, as we won't be able to parse
         * and normalize their suffix Dn
         */
        schemaManager.loadAllEnabled();

        final List<Throwable> errors = schemaManager.getErrors();

        if (errors.size() != 0) {
            throw new Exception(I18n.err(I18n.ERR_317,
                                         Exceptions.printErrors(errors)));
        }

        this.service.setSchemaManager(schemaManager);

        /*
         * Init the LdifPartition with schema
         */
        final LdifPartition schemaLdifPartition = new LdifPartition(schemaManager);
        schemaLdifPartition.setPartitionPath(schemaPartitionDirectory.toURI());

        /*
         * The schema partition
         */
        final SchemaPartition schemaPartition = new SchemaPartition(schemaManager);
        schemaPartition.setWrappedPartition(schemaLdifPartition);
        this.service.setSchemaPartition(schemaPartition);
    }
942582
public final int setPartitionColumnName(String partitionColumnName) {
        if (partitionColumnName == null || partitionColumnName.trim().isEmpty()) {
            return PARTITION_ID_INDEX;
        }
        int idx = -1;
        for (String name : m_source.columnNames) {
            if (name.equalsIgnoreCase(partitionColumnName)) {
                idx = m_source.columnNames.indexOf(name);
                break;
            }
        }
        if (idx == -1) {
            m_partitionColumnIndex = PARTITION_ID_INDEX;
            m_logger.error("Export configuration error: specified " + m_source.tableName + "." + partitionColumnName
                    + " does not exist. A default partition or routing key will be used.");
        } else {
            m_partitionColumnIndex = idx;
        }
        return m_partitionColumnIndex;
    }
686117
public static Schema partitionFieldSchema(FieldPartitioner<?, ?> fp, Schema schema) {
    if (fp instanceof IdentityFieldPartitioner) {
      // copy the schema directly from the entity to preserve annotations
      return fieldSchema(schema, fp.getSourceName());
    } else {
      Class<?> fieldType = getPartitionType(fp, schema);
      if (fieldType == Integer.class) {
        return Schema.create(Schema.Type.INT);
      } else if (fieldType == Long.class) {
        return Schema.create(Schema.Type.LONG);
      } else if (fieldType == String.class) {
        return Schema.create(Schema.Type.STRING);
      } else {
        throw new ValidationException(
            "Cannot encode partition " + fp.getName() +
                " with type " + fp.getSourceType()
        );
      }
    }
  }
1057433
static String getSchemaPath(String projectFilePath, String path) throws IOException
    {
        File file = null;

        if (path.contains(".jar!")) {
            String ddlText = null;
            ddlText = VoltCompilerUtils.readFileFromJarfile(path);
            file = VoltProjectBuilder.writeStringToTempFile(ddlText);
        }
        else {
            file = new File(path);
        }

        if (!file.isAbsolute()) {
            // Resolve schemaPath relative to either the database definition xml file
            // or the working directory.
            if (projectFilePath != null) {
                file = new File(new File(projectFilePath).getParent(), path);
            }
            else {
                file = new File(path);
            }
        }

        return file.getPath();
    }