I figured out a solution to this error. So by just creating an empty streaming table with rate source we cannot specify the schema we want. We have to build on top of it and edit the schemas. This is what I mean

            @dlt.table(name=table_name)
            def empty_table():
                log_event(logger,f"Creating empty DLT streaming table: {table_name}.", "INFO")
                
                # Create a dummy streaming DataFrame with the `rate` source
                streaming_df = spark.readStream.format("rate").option("rowsPerSecond", 1).load()

                # Map the `rate` source columns to match the schema with default null values
                empty_stream_df = streaming_df.select(
                    *[
                        lit(None).cast(field.dataType).alias(field.name)
                        for field in schema.fields
                    ]
                ).where("1=0")  # Ensures the stream is empty

                return empty_stream_df

 If this looks correct. @Alberto_Umana . Just send a like. I will accept it as a solution. If you have something better then plz do tell me about it