1 Can I give a different name to target table
2 the target table is created by airbyte, the column type does not match to original table, why is that? I am using SqlServer
besides the airbyte??? columns, the other column types do not match and also in random order, the original PK is removed, etc. Is this by desigin?
ie, my src table is:
CREATE TABLE [dbo].[t_stg](
[ETL_CREATE_DATE] [datetime] NULL,
[ETL_MODIFIED_DATE] [datetime] NULL,
[ETL_YEAR_MONTH] [int] NULL,
[ETL_PROCESSED_FLAG] [varchar](1) NULL,
[SEQUENCE_NO] [int] NULL,
[YrPrd] [int] NOT NULL,
[item_no] [varchar](30) NOT NULL,
[location_id] [int] NOT NULL,
[rev] [float] NULL,
[cost] [float] NULL,
PRIMARY KEY CLUSTERED
(
[YrPrd] ASC,
[item_no] ASC,
[location_id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
the autogenerated target table is
CREATE TABLE [dbo].[t_stg](
[_airbyte_unique_key] [varchar](32) NULL,
[rev] [float] NULL,
[cost] [float] NULL,
[yrprd] [bigint] NULL,
[item_no] [nvarchar](max) NULL,
[sequence_no] [bigint] NULL,
[location_id] [bigint] NULL,
[etl_year_month] [bigint] NULL,
[etl_create_date] [nvarchar](max) NULL,
[etl_modified_date] [nvarchar](max) NULL,
[etl_processed_flag] [nvarchar](max) NULL,
[_airbyte_ab_id] [varchar](64) NOT NULL,
[_airbyte_emitted_at] [datetimeoffset](7) NULL,
[_airbyte_normalized_at] [datetime2](7) NOT NULL,
[_airbyte_t_stg_hashid] [varchar](32) NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object: Index [dbo_t_stg_cci] Script Date: 1/21/2023 120250 AM ******/
CREATE CLUSTERED COLUMNSTORE INDEX [dbo_t_stg_cci] ON [dbo].[t_stg] WITH (DROP_EXISTING = OFF, COMPRESSION_DELAY = 0, DATA_COMPRESSION = COLUMNSTORE) ON [PRIMARY]
GO