spark导入mysql 报错reimport ngql failed for SyntaxError: syntax error near `Z� �'

  • nebula 版本:2.5
  • 部署方式:单机
  • 是否为线上版本:N
  • 硬件信息
    • 磁盘((HDD)

exchange 执行导入命令导入mysql数据报错
spark 版本:2.4.5
mysql版本:5.6
exchange:2.5.0
mysql-connector-java版本:mysql-connector-java-5.1.49.jar
报错如下,配置文件应该没有问题,因为有些数据能够导入,有些数据不能。可能是数据库是varchar(255),但是对应的图数据库是string所以导入失败?这种问题应该怎么解决呢?

21/10/08 17:05:00 ERROR NebulaGraphClientWriter: reimport ngql failed for SyntaxError: syntax error near `Z� �'
21/10/08 17:05:00 INFO NebulaGraphClientWriter: INSERT VERTEX `user`(`uid`,`name`) VALUES "}f�K": (63756, "}f�K"), "L?��K": (76068, "L?��K"), "�}���@(�)	Pl�	from�F��"Z� �		Pl�": (2010276, "�}���@(�)	Pl�	from�F��"Z� �		Pl�")
21/10/08 17:05:00 INFO FileScanRDD: Reading File path: file:///tmp/errors/user.24, range: 0-7273, partition values: [empty row]
21/10/08 17:05:00 ERROR NebulaGraphClientWriter: reimport ngql failed for SyntaxError: syntax error near `Z� �'
21/10/08 17:05:00 INFO NebulaGraphClientWriter: INSERT VERTEX `user`(`uid`,`name`) VALUES "��(7": (232270332, "��(7"), "��": (232270732, "��"), "�K�": (229348732, "�K�"), "�K�": (138272132, "�K�"), "V�uuE": (138262852, "V�uuE"), "K:(7": (232265916, "K:(7"), "�": (232280028, "�"), "�K�": (138264652, "�K�"), "��K�": (232271852, "��K�"), "K:(7": (232268444, "K:(7"), "K:(7": (191321420, "K:(7"), "'3N_ATF": (232282124, "'3N_ATF"), "K:(7": (232265932, "K:(7"), "K:(7": (191334844, "K:(7"), "K:(7": (191321212, "K:(7"), "FF�": (20000196, "FF�"), "K:(7": (191318556, "K:(7"), ">)": (20002116, ">)"), "K:(7": (232280412, "K:(7"), "Acc�": (191320028, "Acc�"), "K:(7": (232275788, "K:(7"), "K:(7": (232276396, "K:(7"), "�K�": (232266164, "�K�"), "��(7": (138272548, "��(7"), "�K�": (232271484, "�K�"), "K:(7": (191342332, "K:(7"), "K:(7": (232278028, "K:(7"), "K�": (232279740, "K�"), "�": (191320204, "�"), "�K�": (191345900, "�K�"), "4��": (229350036, "4��"), "�K�": (232273356, "�K�"), "ghh_���": (138263580, "ghh_���"), "K:(7": (191318532, "K:(7"), "��K�": (229350468, "��K�"), "V��u�": (138268828, "V��u�"), "uerrrrrrrrrrrrrrrr": (138261884, "uerrrrrrrrrrrrrrrr"), "tacit": (20003652, "tacit"), "&
                                                                           ": (20002724, "&
           "), "�K�": (232267316, "�K�"), "�		": (232278228, "�	"), "Acc�": (232279612, "Acc�"), "��K�": (232271308, "��K�"), "account�": (138269436, "account�"), "K:(7": (191337436, "K:(7"), "�_S Z": (20005708, "�_S Z"), "K:(7": (191341460, "K:(7"), "K:(7": (191317972, "K:(7"), "h��": (228635700, "h��"), "testor": (191333716, "testor"), "��K�": (232275860, "��K�"), "��": (191321276, "��"), "�": (232277972, "�"), "h��": (232276764, "h��"), "K:(7": (229350132, "K:(7"), "��(7": (232271940, "��(7"), "K:(7": (232262708, "K:(7"), "Acc�": (191337268, "Acc�"), "K:(7": (191335316, "K:(7"), "tberg": (20001852, "tberg"), "((_v": (20000404, "((_v"), "K:(7": (232272548, "K:(7"), "K:(7": (232280756, "K:(7"), "�K�": (138270412, "�K�"), "K:(7": (232262836, "K:(7"), "Acc�": (138269860, "Acc�"), "��(7": (232278364, "��(7"), "h��": (138266228, "h��"), "Grace�

                                                                    ": (20005324, "Grace�

         "), "K:(7": (138271284, "K:(7"), "��(7": (191321148, "��(7"), "Acc�": (191341988, "Acc�"), "K:(7": (232270556, "K:(7"), "account�": (138265948, "account�"), "�K�": (228635492, "�K�"), "K:(7": (191321284, "K:(7"), "K:(7": (232279196, "K:(7"), "K:(7": (232274252, "K:(7"), "��": (191343228, "��"), "testor": (191333764, "testor"), "��(7": (232267932, "��(7"), "testor": (191337116, "testor"), "K:(7": (228635172, "K:(7"), "��": (138272556, "��"), "��": (138272236, "��"), "�}��": (138265076, "�}��"), "V��uE	": (138269196, "V��uE	"), "h��": (229350436, "h��"), "��K�": (232266076, "��K�"), "��": (20002964, "��"), "K:(7": (232275348, "K:(7"), "�K�": (191334116, "�K�"), "��K�": (232279028, "��K�"), "K:(7": (138266380, "K:(7"), "��(7": (232277204, "��(7"), "K:(7": (191346348, "K:(7"), "��K�": (232278372, "��K�"), "K:(7": (191321540, "K:(7"), "��": (191334404, "��"), "�K�": (191341348, "�K�"), "��(7": (232281212, "��(7"), "K:(7": (229350724, "K:(7"), "��(7": (232277092, "��(7"), "��K�": (232269532, "��K�"), "�K�": (232271644, "�K�"), "��(7": (138272460, "��(7"), "h��": (232269324, "h��"), "��(7": (232274412, "��(7"), "K:(7": (191320932, "K:(7"), "cc": (20000668, "cc"), "K:(7": (232271916, "K:(7"), "Leo": (20003972, "Leo"), "h��": (138271964, "h��"), "V�u�u�": (138263004, "V�u�u�"), "��": (191346628, "��"), "K:(7": (232276404, "K:(7"), "K:(7": (191343956, "K:(7"), "K:(7": (191317876, "K:(7"), "�K�": (232265924, "�K�"), "V��u	�": (191325100, "V��u	�"), "V��u	�": (138268564, "V��u	�"), "K:(7": (232267644, "K:(7"), "w~(�K:~
                                        APP)": (20000164, "w~(�K:~
                                                                 APP)"), "account�": (138271492, "account�"), "K:(7": (232264564, "K:(7"), "K:(7": (191343740, "K:(7"), "K:(7": (138271956, "K:(7"), "h��": (138264036, "h��"), "Acc�": (232262644, "Acc�"), "Acc�": (232267892, "Acc�"), "��K�": (232276364, "��K�"), "�	�": (138262220, "�	�"), "K:(7": (232275612, "K:(7"), "K:(7": (191334172, "K:(7"), "CHRIS\�": (20003996, "CHRIS\�"), "Acc�": (191335124, "Acc�"), "K:(7": (232264908, "K:(7"), "testor": (191321492, "testor"), "K:(7": (191345932, "K:(7"), "K:(7": (138266564, "K:(7"), "��(7": (232275684, "��(7"), "A\'�' c": (20003564, "A\'�' c"), "K:(7": (191335540, "K:(7"), "��K�": (232265804, "��K�"), "��K�": (229350708, "��K�"), "K:(7": (232277004, "K:(7"), "V��u��": (191325084, "V��u��"), "K:(7": (138272212, "K:(7"), "K:(7": (232275732, "K:(7"), "K:(7": (232278796, "K:(7"), "K:(7": (138267284, "K:(7"), "K:(7": (232271540, "K:(7"), "Acc�": (232263260, "Acc�"), "account�": (138266156, "account�"), "account�": (138266780, "account�"), "K:(7": (232268388, "K:(7"), "K:(7": (191341548, "K:(7"), "K:(7": (232261236, "K:(7"), "K:(7": (138268156, "K:(7"), "Acc�": (232270140, "Acc�"), "��(7": (232274100, "��(7"), "K:(7": (138264740, "K:(7"), "K:(7": (191341380, "K:(7"), "K:(7": (191345588, "K:(7"), "��(7": (232268100, "��(7"), "K�": (229348596, "K�"), "K:(7": (232281428, "K:(7"), "Y": (20004252, "Y"), "��(7": (228635676, "��(7"), "K:(7": (191320348, "K:(7"), "K:(7": (229350076, "K:(7"), "K:(7": (191319692, "K:(7"), "��": (191318956, "��"), "�K�": (232267396, "�K�"), "��K�": (232279956, "��K�"), "��": (191345884, "��"), "Acc�": (232264716, "Acc�"), "K:(7": (232271532, "K:(7"), "��": (191344844, "��"), "K:(7": (191321380, "K:(7"), ",�(��Qܡ�Pl�)": (2010268, ",�(��Qܡ�	Pl�)"), "��(7": (232273412, "��(7"), "4�": (20003468, "4�"), "K:(7": (138264148, "K:(7"), "K:(7": (191335780, "K:(7"), "V��u	mE": (138268612, "V��u	mE"), "K:(7": (232278484, "K:(7"), "�K�": (232270084, "�K�"), "��": (229349652, "��"), "'3N_ATF": (232283020, "'3N_ATF"), "K:(7": (191345532, "K:(7"), "h��": (191337468, "h��"), "K:(7": (229349772, "K:(7"), "��(7": (191347724, "��(7"), "'3N_ATF": (232281748, "'3N_ATF"), "��(7": (232278340, "��(7"), "K:(7": (232262492, "K:(7"), "h��": (232268284, "h��"), "��": (191320076, "��"), "K:(7": (232262700, "K:(7"), "��K�": (232279348, "��K�"), "��(7": (191347500, "��(7"), "K:(7": (191335876, "K:(7"), "K:(7": (232280564, "K:(7"), "K:(7": (138272268, "K:(7"), "V��uE�": (191325156, "V��uE�"), "}": (191337708, "}"), "Acc�": (228635692, "Acc�"), "K:(7": (191342244, "K:(7"), "�K�": (191342308, "�K�"), "~": (20002748, "~"), "account�": (138267524, "account�"), "��": (191320068, "��"), "�K�": (191342876, "�K�"), "K:(7": (138269348, "K:(7"), "�}���р(�)	Pl�	from�F��"Z� �		Pl�": (2010276, "�}���р(�)	Pl�	from�F��"Z� �	Pl�"), "Evan": (20000084, "Evan"), "K:(7": (138267268, "K:(7"), "��": (191346852, "��"), "K:(7": (138266220, "K:(7"), "��K�": (232269004, "��K�"), "account�": (138270164, "account�"), "Acc�": (232267620, "Acc�"), "��K�": (232279396, "��K�"), "4��": (232271676, "4��"), "��": (229350044, "��"), "��K�": (232277884, "��K�"), "��K�": (232272588, "��K�"), "��": (229350012, "��"), "K:(7": (191337196, "K:(7")

你这个问题貌似是"�}���@(�) Pl� from�F��"Z� � 这个insert 语句里面这部分的格式不对。
应该是"vid":(value).

nebula中string是不定长的字符串类型。
你看看你用的是string类型还是fixed_string类型.

1 个赞

[quote=“com, post:1, topic:6034”]
2010276
[/quote]用的是string类型

对应数据库里的数据是–“首汽约车(首约科技(北京)有限公司)from代理商:玩咖欢聚文化传媒(北京)有限公司”,感觉是不是因为长度太大了

嗯嗯,你desc space 看下,你的vid_type是不是fixed_string以及长度。
然后把上面这个value手动插入试试,调试下。