Strictly speaking, the documentation only mentions query operator composition using /*
. It may be that @*
is not supported or has unrevealed semantics.
However, it seems reasonable to assume that @*
would work similarly to /*
. If so, then this looks like a query compilation bug in both versions 10.0.2 and 10.1.0.
Analysis
As noted in the question, the query using /*
compiles successfully:
Normal@Query[Query[Select[#["A"] == 1 &]] /* Query[Select[IntegerQ[#["A"]] &]]]
(* Select[#1["A"] == 1 &] /* Select[IntegerQ[#1["A"]] &] *)
... but the same query expressed by swapping the operators and using Composition
fails to compile:
Normal@Query[Query[Select[IntegerQ[#["A"]] &]] @* Query[Select[#["A"] == 1 &]]
(* Failure[] *)
An error occurs in this simpler query as well:
Normal@Query[Query["a"] /* Query["b"]]
(* GeneralUtilities`Slice["a", "b"] *)
Normal@Query[Query["b"] @* Query["a"]]
(* Missing[PartInvalid, "a"] *)
And this even simpler query yields a baffling result:
Normal@Query[f /* g]
(* f /* g *)
Normal@Query[g @* f]
(* g[f[Identity]] *)
The result Missing[PartInvalid, "a"]
in particular suggests that perhaps there is an evaluation leak or other improper operator structural transformation somewhere in the compilation process.
@*
is undocumented, so it seems unlikely but possible that it has some unrevealed semantics that are intentionally different from being the "reverse" of /*
. My own guess is that it is a bug.
]
afterSelect[#"A"
. $\endgroup$Dataset[...][Query[Select[#"A"]==1&]]
? That doesn't seem right. Did you meanDataset[...][Select[#A == 1 &]]
? $\endgroup$