From ce44b2be16524338084c7537fd5226afb8bf73d3 Mon Sep 17 00:00:00 2001 From: Anupam Date: Thu, 22 Jun 2023 10:41:10 -0400 Subject: [PATCH] initial --- src/sql/parse.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/sql/parse.py b/src/sql/parse.py index 05bf862e8..ae6be1b57 100644 --- a/src/sql/parse.py +++ b/src/sql/parse.py @@ -53,6 +53,18 @@ def parse(cell, config): if len(pieces) == 1: return result cell = pieces[1] + char_pointer = cell.find("SELECT") + cell = cell[:char_pointer].strip() + " " + cell[char_pointer:] + else: + if pieces[0].endswith("SELECT"): + char_pointer = pieces[0].find("SELECT") + pieces[0] = pieces[0][:char_pointer].replace(" ", "") + pieces[1] = "SELECT " + pieces[1] + else: + char_pointer = pieces[1].find("SELECT") + pieces[0] = pieces[0] + pieces[1][:char_pointer] + pieces[1] = pieces[1][char_pointer:] + # handle no space situation around = if pieces[0].endswith("=<<"): result["result_var"] = pieces[0][:-3]