I ingested data from python application,, it is displayed in topics as shown below.
ksql> print trackline_new_kafka2 ;
Key format: HOPPING(JSON) or TUMBLING(JSON) or JSON or HOPPING(KAFKA_STRING) or TUMBLING(KAFKA_STRING) or KAFKA_STRING
Value format: JSON or KAFKA_STRING
rowtime: 2024/08/06 17:18:41.333 Z, key: [3@3473744501664657456/-], value: {“TRACK_COG”: 30.0, “TRACK_SOG”: 13.3, “TRACK_DESTINATION1”: “PTLEI”, “TRACK_TIME”: 1722826385000, “TRACK_GEARTYP”: “Other”, “TRACK_TYPE”: 71, “MMSI”: 305886000, “TRACK_ALERTID”: 1, “TRACK_LINE”: {“type”: “LineString”, “coordinates”: [[-9.439538333333331, 40.0092], [-9.412451666666668, 40.046238333333335]]}}, partition: 0
rowtime: 2024/08/06 17:18:42.376 Z, key: [3@3474586727605088304/-], value: {“TRACK_COG”: 183.6, “TRACK_SOG”: 1.6, “TRACK_DESTINATION1”: “TR IZT>NL VLI “, “TRACK_TIME”: 1722826738000, “TRACK_GEARTYP”: “Other”, “TRACK_TYPE”: 70, “MMSI”: 308688000, “TRACK_ALERTID”: 1, “TRACK_LINE”: {“type”: “LineString”, “coordinates”: [[-9.58512, 40.50931833333333], [-9.585203333333334, 40.50868166666667], [-9.58525, 40.50819166666667], [-9.585251666666666, 40.50811833333333], [-9.585311666666666, 40.50762], [-9.585365, 40.50690166666666], [-9.585436666666668, 40.505586666666666], [-9.585473333333336, 40.50520166666667], [-9.585541666666668, 40.50438], [-9.585575, 40.50393999999999], [-9.585605, 40.50351166666667], [-9.585666666666668, 40.50275333333333], [-9.58578, 40.50158833333333], [-9.585798333333337, 40.501221666666666], [-9.585916666666666, 40.49966833333334], [-9.585948333333333, 40.49920333333333], [-9.585971666666667, 40.49877], [-9.585965, 40.49822833333334], [-9.585956666666668, 40.49780666666666], [-9.585948333333333, 40.49738166666667], [-9.585936666666669, 40.49691166666666], [-9.585933333333331, 40.49682166666666], [-9.585956666666668, 40.49634666666667], [-9.585958333333334, 40.495871666666666], [-9.58595, 40.495455], [-9.586003333333334, 40.49389], [-9.585976666666664, 40.49317], [-9.585946666666668, 40.49277666666667], [-9.585898333333336, 40.492415], [-9.585785, 40.49150833333333], [-9.585691666666666, 40.490903333333335], [-9.585576666666666, 40.49006166666666], [-9.585541666666668, 40.48975], [-9.585508333333332, 40.489], [-9.585483333333334, 40.48863166666667], [-9.585453333333334, 40.48788833333333], [-9.585453333333334, 40.487523333333336], [-9.585448333333334, 40.487388333333335], [-9.585435, 40.487175], [-9.585421666666669, 40.48684166666667], [-9.585415, 40.48647666666667], [-9.585425, 40.48606166666666], [-9.585405, 40.485705], [-9.5854, 40.48534166666666], [-9.585411666666666, 40.48495833333333], [-9.585408333333334, 40.48459833333333], [-9.585415, 40.48423], [-9.585436666666668, 40.48341333333334], [-9.585453333333334, 40.48263], [-9.58539, 40.48152666666667], [-9.585386666666666, 40.481451666666665], [-9.58539, 40.48103166666667], [-9.585396666666666, 40.480645], [-9.585395, 40.48063166666667], [-9.585391666666668, 40.47989333333333], [-9.585401666666666, 40.479485], [-9.585426666666669, 40.47911166666667], [-9.585456666666666, 40.478865000000006], [-9.585495, 40.47864166666667], [-9.585535, 40.47827166666666], [-9.585595, 40.47785], [-9.585641666666668, 40.477435], [-9.58575, 40.47661666666667], [-9.585765, 40.47652166666667], [-9.585815, 40.476045], [-9.58587, 40.47557166666666], [-9.585905, 40.475211666666674], [-9.585901666666668, 40.47481833333333], [-9.585915, 40.47425833333333], [-9.58592, 40.47415], [-9.58594, 40.47383333333333], [-9.585966666666668, 40.473525], [-9.585986666666669, 40.47325166666667], [-9.586078333333337, 40.471246666666666], [-9.586073333333331, 40.47082], [-9.586055, 40.470416666666665], [-9.586026666666667, 40.47003], [-9.585971666666667, 40.46955166666667], [-9.585943333333336, 40.46930333333333], [-9.58594, 40.46916333333333]]}}, partition: 1
- where as when i transform and create new stream TRACKLINE_NEW_KAFKA_AVRO1 using as select from trackline_new_kafka2 i got into an issue of track_line with extra spaces “{“type”:”LineString”,”coordinates”:”
print TRACKLINE_NEW_KAFKA_AVRO1;
Key format: AVRO or HOPPING(KAFKA_STRING) or TUMBLING(KAFKA_STRING) or KAFKA_STRING
Value format: AVRO
rowtime: 2024/08/06 17:18:17.668 Z, key: 263625000, value: {“MMSI1”: “263625000”, “TRACK_ALERTID”: 1, “TRACK_DESTINATION1”: “SINES”, “TRACK_GEARTYP”: “Other”, “TRACK_SOG”: 1.7, “TRACK_COG”: 339.8, “track_time”: 1722825915000, “track_line”: “{“type”:”LineString”,”coordinates”:[[-8.840768333333333,37.92832666666666],[-8.8416,37.927328333333335],[-8.84166,37.92728833333333],[-8.841531666666667,37.926991666666666],[-8.840655,37.92641666666667],[-8.839528333333334,37.92579833333333],[-8.836868333333333,37.92324],[-8.834126666666666,37.91976666666667],[-8.83299,37.91762666666667],[-8.833081666666667,37.91513166666667],[-8.833348333333333,37.91251833333333],[-8.834048333333334,37.90990166666666],[-8.834354999999999,37.908141666666666],[-8.833993333333332,37.90468333333333],[-8.833319999999999,37.90202833333333],[-8.832346666666666,37.89951666666666],[-8.830919999999999,37.89761666666666],[-8.830758333333334,37.89794],[-8.831214999999998,37.89858166666667],[-8.831545,37.90013333333333],[-8.831476666666667,37.90363],[-8.832005,37.90716666666666],[-8.832108333333334,37.90798333333333],[-8.832251666666668,37.90867],[-8.833178333333333,37.91023833333334],[-8.834358333333334,37.91298333333334],[-8.835081666666667,37.91439333333334],[-8.836663333333332,37.91679666666666],[-8.837593333333333,37.918155],[-8.838258333333332,37.91928333333333],[-8.840010000000001,37.92144833333334],[-8.840390000000001,37.922435],[-8.840886666666668,37.923325],[-8.84211,37.92570333333333],[-8.84211,37.92624166666667],[-8.841726666666666,37.926455],[-8.841495,37.92654166666667],[-8.841233333333333,37.92712333333333],[-8.840711666666666,37.92731833333333],[-8.839903333333332,37.927425],[-8.839803333333332,37.927416666666666],[-8.83972,37.927505],[-8.839838333333335,37.92782833333333],[-8.839901666666666,37.92809666666667],[-8.839886666666667,37.92776666666667],[-8.839975,37.92783666666666],[-8.840126666666666,37.927996666666665],[-8.840368333333334,37.928235],[-8.84055,37.928383333333336],[-8.840553333333334,37.92827333333333],[-8.84115,37.92835333333333],[-8.841655,37.92849833333333],[-8.842751666666667,37.929026666666665],[-8.84319,37.92958333333333],[-8.84319,37.92958333333333]]}”}, partition: 0
- Problem i am facing is when is send TRACKLINE_NEW_KAFKA_AVRO1 to elasticseach using sink connector , there are the quotes(“””) ass at the beining and ending of trak_line
{
“TRACK_COG”: 183.5,
“TRACK_SOG”: 10.5,
“TRACK_DESTINATION1”: “NA”,
“TRACK_TIME”: 1722826729000,
“TRACK_GEARTYP”: “other_purse_seines”,
“TRACK_TYPE”: 30,
“MMSI”: 204245000,
“TRACK_ALERTID”: 1,
“TRACK_LINE”: “””{“type”: “LineString”, “coordinates”: [[-8.74089, 41.20455333333334], [-8.748355, 41.21344833333333], [-8.768325, 41.24265333333334], [-8.76957, 41.248835], [-8.772098333333334, 41.27016], [-8.772423333333334, 41.27274666666666], [-8.776511666666666, 41.30482], [-8.776786666666668, 41.30737166666667], [-8.781336666666666, 41.344205], [-8.794711666666666, 41.34473666666667], [-8.796753333333333, 41.297355], [-8.796911666666666, 41.29405666666666], [-8.79782, 41.27321666666667], [-8.797941666666667, 41.27041666666666], [-8.798390000000001, 41.26297]]}”””
}
4.If if remove quotes(“””) and try injesting data from dev cosnole in to index , i am able to ingest.
- Question is why are these quotes(“””) getting adding to track_line feild from topic trackline_new_kafka2 to TRACKLINE_NEW_KAFKA_AVRO1 …
help me to overcome this issue…
1.If if remove quotes(“””) and try ingesting from dev cosnole i am able to ingest.
- Question is why are these quotes(“””) getting adding to track_line feild from topic trackline_new_kafka2 to TRACKLINE_NEW_KAFKA_AVRO1 …
i have tried changing data types and remove quotes while creating strem..but nothin helped
help me to overcome this issue…
AAE ENTERPRISE is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.