betodealmeida / shillelagh

Making it easy to query APIs via SQL
MIT License
374 stars 50 forks source link

GenericJSON only parse 64 tags #437

Closed sh4m3 closed 1 week ago

sh4m3 commented 4 months ago

I call a service that returns a JSON with 90 tags, but I see that only the first 64 are parsed

Is there a limit in the tool that only allows parsing 64 tags?

I am using it with Superset

betodealmeida commented 3 months ago

@sh4m3 can you share the query you're running?

betodealmeida commented 1 week ago

I stumbled upon this recently, it's a limitation of SQLite. I have a fix in progress.

betodealmeida commented 1 week ago

@sh4m3 I tested with the main branch and I was able to get all the fields from a JSON with 100 fields. I'm going to close the ticket, but if you encounter the same problem please let me know and share the URL so I can repro. Thanks!

betodealmeida commented 1 week ago

For reference, this is how I tested:

from flask import Flask, jsonify

app = Flask(__name__)

@app.route("/data", methods=["GET"])
def get_data():
    data = {
        "series": [
            {f"col_{i}": i for i in range(100)},
            {f"col_{i}": i + 100 for i in range(100)},
        ]
    }
    return jsonify(data)

if __name__ == "__main__":
    app.run(debug=True)

And the query:

🍀> SELECT * FROM "http://127.0.0.1:5000/data#$.series[*]";
  col_0    col_1    col_10    col_11    col_12    col_13    col_14    col_15    col_16    col_17    col_18    col_19    col_2    col_20    col_21    col_22    col_23    col_24    col_25    col_26    col_27    col_28    col_29    col_3    col_30    col_31    col_32    col_33    col_34    col_35    col_36    col_37    col_38    col_39    col_4    col_40    col_41    col_42    col_43    col_44    col_45    col_46    col_47    col_48    col_49    col_5    col_50    col_51    col_52    col_53    col_54    col_55    col_56    col_57    col_58    col_59    col_6    col_60    col_61    col_62    col_63    col_64    col_65    col_66    col_67    col_68    col_69    col_7    col_70    col_71    col_72    col_73    col_74    col_75    col_76    col_77    col_78    col_79    col_8    col_80    col_81    col_82    col_83    col_84    col_85    col_86    col_87    col_88    col_89    col_9    col_90    col_91    col_92    col_93    col_94    col_95    col_96    col_97    col_98    col_99
-------  -------  --------  --------  --------  --------  --------  --------  --------  --------  --------  --------  -------  --------  --------  --------  --------  --------  --------  --------  --------  --------  --------  -------  --------  --------  --------  --------  --------  --------  --------  --------  --------  --------  -------  --------  --------  --------  --------  --------  --------  --------  --------  --------  --------  -------  --------  --------  --------  --------  --------  --------  --------  --------  --------  --------  -------  --------  --------  --------  --------  --------  --------  --------  --------  --------  --------  -------  --------  --------  --------  --------  --------  --------  --------  --------  --------  --------  -------  --------  --------  --------  --------  --------  --------  --------  --------  --------  --------  -------  --------  --------  --------  --------  --------  --------  --------  --------  --------  --------
      0        1        10        11        12        13        14        15        16        17        18        19        2        20        21        22        23        24        25        26        27        28        29        3        30        31        32        33        34        35        36        37        38        39        4        40        41        42        43        44        45        46        47        48        49        5        50        51        52        53        54        55        56        57        58        59        6        60        61        62        63        64        65        66        67        68        69        7        70        71        72        73        74        75        76        77        78        79        8        80        81        82        83        84        85        86        87        88        89        9        90        91        92        93        94        95        96        97        98        99
    100      101       110       111       112       113       114       115       116       117       118       119      102       120       121       122       123       124       125       126       127       128       129      103       130       131       132       133       134       135       136       137       138       139      104       140       141       142       143       144       145       146       147       148       149      105       150       151       152       153       154       155       156       157       158       159      106       160       161       162       163       164       165       166       167       168       169      107       170       171       172       173       174       175       176       177       178       179      108       180       181       182       183       184       185       186       187       188       189      109       190       191       192       193       194       195       196       197       198       199
(2 rows in 0.04s)

🍀>