1

I have joined two tables and fetched data using Postgres source connector. But every time it gave the same issue i.e. enter image description here

I have run the same query in Postgres and it runs without any issue. Is fetching data by joining tables not possible in Kafka?

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Sajita
  • 41
  • 5
  • Each time upper and lowercase letters are mixed in direction of _Postgresql_ from a `Dataset`, it produces a mess, and one is looking for a field named `p_CreateDate` when the other searches for `"p_CreateDate"` with additional quotes. The best is to keep all lowercase. Here, your trouble is that one is looking for `p_CreatedDate` and the other `p.CreatedDate`. One with a point near the `p`, the other with an underline character. – Marc Le Bihan Jan 19 '21 at 08:37
  • @MarcLeBihan actually p_CreatedDate is an alias. Actually this is my query: "SELECT \"p\".\"Id\" as \"p_Id\",\"p\".\"CreatedDate\" as \"p_CreatedDate\",\"DocumentNumber\",\"p\".\"ClassId\" as \"p_ClassId\",\"c\".\"Id\" as \"c_Id\",\"c\".\"CreatedDate\" as \"c_CreatedDate\", \"DocumentNo\",\"c\".\"ClassId\" as \"c_ClassId\" FROM \"public\".\"PolicyIssuance\" \"p\" left join \"public\".\"ClassDetails\" \"c\" on \"p\".\"DocumentNumber\" = \"c\".\"DocumentNo\"" – Sajita Jan 19 '21 at 09:45

1 Answers1

0

I solve this issue by using the concept of the subquery. The problem was that
when I use an alias, the alias column is interpreted as a whole as a column name and therefore the problem occurs. Here goes my query: select * from (select p.\"Id\" as \"p_Id\", p.\"CreatedDate\" as p_createddate, p.\"ClassId\" as p_classid, c.\"Id\" as c_id, c.\"CreatedDate\" as c_createddate, c.\"ClassId\" as c_classid from \"PolicyIssuance\" p left join \"ClassDetails\" c on p.\"DocumentNumber\" = c.\"DocumentNo\") as result"

Sajita
  • 41
  • 5