# KCQL Syntax Parse Failure - GCP Storage - Wildcards in Target

**URL:** <https://ask.lenses.io/t/kcql-syntax-parse-failure-gcp-storage-wildcards-in-target/251>\
**Category:** General\
**Tags:** kafka-connect\
**Created:** [June 14, 2024, 12:37pm UTC](https://ask.lenses.io/t/kcql-syntax-parse-failure-gcp-storage-wildcards-in-target/251 "2024-06-14T12:37:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidsloan](https://dub1.discourse-cdn.com/flex017/user_avatar/ask.lenses.io/davidsloan/32/52_2.png) [@davidsloan](https://ask.lenses.io/u/davidsloan)\
**Post date:** [June 14, 2024, 12:37pm UTC](https://ask.lenses.io/t/kcql-syntax-parse-failure-gcp-storage-wildcards-in-target/251/1 "2024-06-14T12:37:01Z")

</div>

I am using the GCS Sink. I need some help writing a KCQL query to put data in GCS hourly buckets named after Kafka topics

I am getting the following exception:

```auto
java.lang.IllegalArgumentException: Invalid syntax.failed to parse at line 1 due to extraneous input '*' expecting SELECT at io.lenses.kcql.Kcql.parse(Kcql.java:706

```

I’m using this query:

```sql
connect.gcpstorage.kcql = INSERT INTO `your-bucket-name:stage-parquet/`*`` SELECT * FROM `*` PARTITIONBY _header.date STOREAS PARQUET PROPERTIES ('partition.include.keys'=false, 'flush.count'=50, 'flush.interval'=600)

```

---

<div class="post-metadata">

**Author:** ![davidsloan](https://dub1.discourse-cdn.com/flex017/user_avatar/ask.lenses.io/davidsloan/32/52_2.png) [@davidsloan](https://ask.lenses.io/u/davidsloan)\
**Post date:** [June 14, 2024, 12:37pm UTC](https://ask.lenses.io/t/kcql-syntax-parse-failure-gcp-storage-wildcards-in-target/251/2 "2024-06-14T12:37:33Z")

</div>

The error message indicates that the wildcard in the target bucket isn’t correct KCQL syntax.

To dynamically use the topic name as a partition, include it in the `PARTITIONBY` clause. Please try the following query:

```sql
INSERT INTO `your-bucket-name:stage-parquet/` SELECT * FROM `*` PARTITIONBY _topic, _header.date STOREAS PARQUET PROPERTIES ('partition.include.keys'=false, 'flush.count'=50, 'flush.interval'=600)

```

This should resolve the syntax error and correctly partition your data by topic and date.
