Auto-detect 'column' fields in Quicksight CDK API?

Using the quicksight dashboard UI, I can always create a new DataSet in my dashboard, and the DataSet will automatically show me all the columns in it. However, using the CDK, it seems that column is a required field. Is there a way to auto-detect the column names?

The SDK documentation for CDK function doesn’t seem to describe how to ignore ‘column’: CfnDataSet — AWS Cloud Development Kit 2.213.0 documentation


new quicksight.CfnDataSet(this, dataSetName, {
      awsAccountId: this.account,
      dataSetId: dataSetName,
      name: dataSetName,
      importMode: 'DIRECT_QUERY',
      physicalTableMap: {
        physicalMapId: {
          customSql: {
            dataSourceArn: dataSourceArn,
            name: queryName,
            columns: [
              { name: 'need_to_manually_define_each_column_for_each_table' type: 'STRING' },
            ],
            sqlQuery: `SELECT * FROM 'database'.'table'`,
          },
        },
      },
      datasetParameters: [
        {
          stringDatasetParameter: {
            id: 'xxx',
            name: 'xxx',
            valueType: 'SINGLE_VALUED',
            defaultValues: {
              staticValues: ['null'],
            },
          },
        },
      ],
      permissions: xxxxxxx
    });

Hi @cinzy and welcome to the QuickSight community!

Currently, I do not believe there’s a way to auto-detect the column names when using the CDK. I will mark this as a feature request to promote visibility to the support team.

Thank you