Ad
  • Custom User Avatar

    bcs. this is stric equality check

  • Custom User Avatar
  • Custom User Avatar
  • Custom User Avatar

    thanks!

  • Custom User Avatar

    I think ORDER BY clauses don't have a guaranteed order in SQL, yeah? Well I think for practical reasons, a kata like this needs to be a bit strict to make testing realistic (having to accomodate all permutations of solution orders across arbitrary levels of nesting will make the tests even more complex). But you're right that if an assumption like this is to be made, then it needs to be explicitly stated the description. The JS version makes it explicit but only in the tests, and the other translations (which I think you were solving) don't make it explicit at all. I think you should reraise this as an issue.

  • Custom User Avatar

    I've double checked the fixed and random tests code and from() is impossible to be generated. from is always either omitted or invoked in the following three forms: from([]), from(table) or from(table, ...) (NOT from([table, ...])). If the issue you're referring to is from being omitted, all clauses are omittable per the requirements (query().execute() is valid), so that couldn't be the issue. If you're referring to from([]), then the empty array is one argument - an empty table, and that's completely valid.

  • Custom User Avatar

    I think the sql statement in the following test is misleading:

    (
                    query().select().from_(persons[:]).group_by(profession, name, age, marital_status),
                    [
                        ["teacher", [
                            ["Peter", [
                                [20, [["married", [
                                    {"name": "Peter", "profession": "teacher", "age": 20, "marital_status": "married"},
                                    {"name": "Peter", "profession": "teacher", "age": 20, "marital_status": "married"}
                                ]]]]
                            ]],
                            ["Michael", [
                                [50, [["single", [
                                    {"name": "Michael", "profession": "teacher", "age": 50, "marital_status": "single"}
                                ]]]]
                            ]]
                        ]],
                        ["scientific", [
                            ["Anna", [[20, [
                                ["married", [
                                    {"name": "Anna", "profession": "scientific", "age": 20, "marital_status": "married"}
                                ]],
                                ["single", [
                                    {"name": "Anna", "profession": "scientific", "age": 20, "marital_status": "single"}
                                ]]
                            ]]]],
                            ["Rose", [[50, [
                                ["married", [
                                    {"name": "Rose", "profession": "scientific", "age": 50, "marital_status": "married"}
                                ]]
                            ]]]]
                        ]],
                        ["politician", [["Anna", [[50, [["married", [
                            {"name": "Anna", "profession": "politician", "age": 50, "marital_status": "married"}
                        ]]]]]]]]
                    ],
                    "SELECT * FROM persons WHERE profession = \"teacher\" GROUP BY profession, name, age", # <----- I think here marital_status is missing??
                )
    
  • Custom User Avatar
  • Custom User Avatar

    C translation issue:
    incorrectly expects p(0)==2

  • Custom User Avatar

    approved

  • Custom User Avatar

    what's with the ordering on the groupby stuff? My solution is not being accepted because it's not the same order as the author's output even though there is no order by clause. I am using dictionaries to get the right structure and I should not be penalized for that.

  • Custom User Avatar

    Thanks for this enjoyable kata! I liked how it made me think about both diagonals at once.
    Clean and fun implementation opportunity.
    Appreciate the challenge and the variety it adds to training!

  • Custom User Avatar
  • Custom User Avatar

    It's 'almost' as same as the previous one with an additional tweak in value return

  • Custom User Avatar

    approved

  • Loading more items...