'Create table from Google Sheet with multi line headings

I have been creating BigQuery tables from Google Sheets via the BQ console GUI. This has been working well, but I am now trying to import a file with multiple heading lines and I don't know how to go about it.

A simple example of what I am trying to import

If I try to auto detect schema and skip the first 2 columns I get the error Failed to create table: Duplicate column names: 'Date'.

If I try and mannually create the schema, similar to below. Then the import works but when I go to query the records I get the error Unsupported field type: RECORD

 [
  {
    "name": "SubjectName",
    "type": "STRING",
    "mode": "NULLABLE"
  },
  {
    "name": "SubjectCode",
    "type": "STRING",
    "mode": "NULLABLE"
  },
  {
    "name": "Class1",
    "type": "RECORD",
    "mode": "NULLABLE",
    "fields": [
      {
        "name": "Date",
        "type": "STRING",
        "mode": "NULLABLE"
      },
      {
        "name": "Tutor",
        "type": "STRING",
        "mode": "NULLABLE"
      }
    ]
  },
  {
    "name": "Class2",
    "type": "RECORD",
    "mode": "NULLABLE",
    "fields": [
      {
        "name": "Date",
        "type": "STRING",
        "mode": "NULLABLE"
      },
      {
        "name": "Tutor",
        "type": "STRING",
        "mode": "NULLABLE"
      }
    ]
  },
  {
    "name": "Class3",
    "type": "RECORD",
    "mode": "NULLABLE",
    "fields": [
      {
        "name": "Date",
        "type": "STRING",
        "mode": "NULLABLE"
      },
      {
        "name": "Tutor",
        "type": "STRING",
        "mode": "NULLABLE"
      }
    ]
  }
]

Is there any way to import a google sheet with multiple headings via the BQ Console gui?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source