ivandasch commented on a change in pull request #8203:
URL: https://github.com/apache/ignite/pull/8203#discussion_r480986451



##########
File path: modules/platforms/python/tests/test_sql.py
##########
@@ -163,56 +163,19 @@ def test_long_multipage_query(client):
     The goal is to ensure that all the values are selected in a right order.
     """
 
-    field_range = range(1, 13)
-
-    record_range = range(1, 21)
-
-    drop_query = 'DROP TABLE LongMultipageQuery IF EXISTS'
-
-    create_query = '''CREATE TABLE LongMultipageQuery (
-        id INT(11) PRIMARY KEY,
-        abc INT(11),
-        ghi INT(11),
-        def INT(11),
-        jkl INT(11),
-        prs INT(11),
-        mno INT(11),
-        tuw INT(11),
-        zyz INT(11),
-        abc1 INT(11),
-        def1 INT(11),
-        jkl1 INT(11),
-        prs1 INT(11),
-    )'''
-
-    insert_query = '''INSERT INTO LongMultipageQuery (
-        id,
-        abc,
-        ghi,
-        def,
-        jkl,
-        prs,
-        mno,
-        tuw,
-        zyz,
-        abc1,
-        def1,
-        jkl1,
-        prs1,
-    ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'''
-
-    select_query = 'SELECT * FROM LongMultipageQuery'
+    fields = ["id", "abc", "ghi", "def", "jkl", "prs", "mno", "tuw", "zyz", 
"abc1", "def1", "jkl1", "prs1"]
 
-    client.sql(drop_query)
-    client.sql(create_query)
+    client.sql('DROP TABLE LongMultipageQuery IF EXISTS')
+
+    client.sql("CREATE TABLE LongMultiPageQuery (%s, %s)" % \
+               (fields[0] + " INT(11) PRIMARY KEY", ",".join(map(lambda f: f + 
" INT(11)", fields[1:]))))

Review comment:
       Even better:
   
   ```
   "CREATE TABLE LongMultiPageQuery (%s)" %  ",".join(map(lambda f: f + " 
INT(11)" if f != "id" else " INT(11) PRIMARY KEY", fields))))
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to