MCPcopy Create free account
hub / github.com/dataform-co/dataform / convertField

Function convertField

cli/api/dbadapters/bigquery.ts:530–544  ·  view source on GitHub ↗
(field: TableField)

Source from the content-addressed store, hash-verified

528}
529
530function convertField(field: TableField): dataform.IField {
531 const result: dataform.IField = {
532 name: field.name,
533 flags: field.mode === "REPEATED" ? [dataform.Field.Flag.REPEATED] : [],
534 description: field.description
535 };
536 if (field.type === "RECORD" || field.type === "STRUCT") {
537 result.struct = dataform.Fields.create({
538 fields: field.fields.map(innerField => convertField(innerField))
539 });
540 } else {
541 result.primitive = convertFieldType(field.type);
542 }
543 return dataform.Field.create(result);
544}
545
546// See: https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#TableFieldSchema
547function convertFieldType(type: string) {

Callers 2

executeRawMethod · 0.85
tableMethod · 0.85

Calls 2

convertFieldTypeFunction · 0.85
createMethod · 0.65

Tested by

no test coverage detected