<commit_before><?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="25">
<Class name="SpatialIndex.SQLResult">
<Super>%SQL.AbstractFind</Super>
<TimeCreated>63812,80595.195041</TimeCreated>

<Property name="ResultBits">
<MultiDimensional>1</MultiDimensional>
<Private>1</Private>
</Property>

<Method name="%OnNew">
<Private>1</Private>
<ReturnType>%Status</ReturnType>
<ServerOnly>1</ServerOnly>
<Implementation><![CDATA[
	kill i%ResultBits
	quit $$$OK
]]></Implementation>
</Method>

<Method name="PrepareFind">
<FormalSpec>indexGlobal:%String,queryType:%String,queryParams:%Binary</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	//for now we only have queryType = window
	for i = 1:1:4 {
		set item = $Piece(queryParams, ",", i)
		set param = $Piece(item, "=", 1)
		set value = $Piece(item, "=" ,2)
		if param = "minx" {
			set minx = value
		} elseif param = "maxx" {
			set maxx = value
		} elseif param = "maxy"{
			set maxy = value
		} elseif param = "miny" {
			set miny = value
		}
	}
	set rset = ##class(%ResultSet).%New("SpatialIndex.QueryExecutor:FindWindow")
 	do rset.Execute(indexGlobal,minx,miny,maxx,maxy)
 	while (rset.Next()){
	 	set id = rset.Get("Id")
	 	set tChunk = (id\64000)+1, tPos=(id#64000)+1
	 	set $BIT(i%ResultBits(tChunk),tPos) = 1
	}
	quit $$$OK
]]></Implementation>
</Method>

<Method name="ContainsItem">
<FormalSpec>pItem:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	set tChunk = (pItem\64000)+1, tPos=(pItem#64000)+1
	quit $bit($get(i%ResultBits(tChunk)),tPos)
]]></Implementation>
</Method>

<Method name="GetChunk">
<FormalSpec>pChunk:%Integer</FormalSpec>
<ReturnType>%Binary</ReturnType>
<Implementation><![CDATA[	quit $get(i%ResultBits(pChunk))
]]></Implementation>
</Method>

<Method name="NextChunk">
<FormalSpec><![CDATA[&pChunk:%Integer=""]]></FormalSpec>
<ReturnType>%Binary</ReturnType>
<Implementation><![CDATA[
	set pChunk = $order(i%ResultBits(pChunk),1,tBits)
	quit:pChunk="" ""
	quit tBits
]]></Implementation>
</Method>

<Method name="PreviousChunk">
<FormalSpec><![CDATA[&pChunk:%Integer=""]]></FormalSpec>
<ReturnType>%Binary</ReturnType>
<Implementation><![CDATA[
	set pChunk = $order(i%ResultBits(pChunk),-1,tBits)
	quit:pChunk="" ""
	quit tBits
]]></Implementation>
</Method>
</Class>
</Export>
<commit_msg>call query executor directly without resultset<commit_after><?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="25">
<Class name="SpatialIndex.SQLResult">
<Super>%SQL.AbstractFind</Super>
<TimeCreated>63812,80595.195041</TimeCreated>

<Property name="ResultBits">
<MultiDimensional>1</MultiDimensional>
<Private>1</Private>
</Property>

<Method name="%OnNew">
<Private>1</Private>
<ReturnType>%Status</ReturnType>
<ServerOnly>1</ServerOnly>
<Implementation><![CDATA[
	kill i%ResultBits
	quit $$$OK
]]></Implementation>
</Method>

<Method name="PrepareFind">
<FormalSpec>indexGlobal:%String,queryType:%String,queryParams:%Binary</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	//for now we only have queryType = window
	for i = 1:1:4 {
		set item = $Piece(queryParams, ",", i)
		set param = $Piece(item, "=", 1)
		set value = $Piece(item, "=" ,2)
		set arg(param) = value
	}
	//set rset = ##class(%ResultSet).%New("SpatialIndex.QueryExecutor:FindWindow")
 	//do rset.Execute(indexGlobal,arg("minx"),arg("miny"),arg("maxx"),arg("maxy"))
 	//while (rset.Next()){
	 //	set id = rset.Get("Id")
	 	set qHandle("indexGlobal") = indexGlobal
	 	do ##class(SpatialIndex.QueryExecutor).InternalFindWindow(.qHandle,arg("minx"),arg("miny"),arg("maxx"),arg("maxy"))
	 	set id = ""
	 	for  {
		 	set id = $O(qHandle("data", id))
		 	quit:id=""
	 		set tChunk = (id\64000)+1, tPos=(id#64000)+1
	 		set $BIT(i%ResultBits(tChunk),tPos) = 1
	 	}
	 	quit $$$OK
]]></Implementation>
</Method>

<Method name="ContainsItem">
<FormalSpec>pItem:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	set tChunk = (pItem\64000)+1, tPos=(pItem#64000)+1
	quit $bit($get(i%ResultBits(tChunk)),tPos)
]]></Implementation>
</Method>

<Method name="GetChunk">
<FormalSpec>pChunk:%Integer</FormalSpec>
<ReturnType>%Binary</ReturnType>
<Implementation><![CDATA[	quit $get(i%ResultBits(pChunk))
]]></Implementation>
</Method>

<Method name="NextChunk">
<FormalSpec><![CDATA[&pChunk:%Integer=""]]></FormalSpec>
<ReturnType>%Binary</ReturnType>
<Implementation><![CDATA[
	set pChunk = $order(i%ResultBits(pChunk),1,tBits)
	quit:pChunk="" ""
	quit tBits
]]></Implementation>
</Method>

<Method name="PreviousChunk">
<FormalSpec><![CDATA[&pChunk:%Integer=""]]></FormalSpec>
<ReturnType>%Binary</ReturnType>
<Implementation><![CDATA[
	set pChunk = $order(i%ResultBits(pChunk),-1,tBits)
	quit:pChunk="" ""
	quit tBits
]]></Implementation>
</Method>
</Class>
</Export>

{'fraction_non_alphanumeric': 0.20664054444215302, 'fraction_numerical': 0.023510002062280884, 'mean_word_length': 7.123953098827471, 'pattern_counts': {'":': 0, '<': 149, '<?xml version=': 2, '>': 149, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5800291', 'n_tokens_mistral': 1917, 'n_tokens_neox': 1790, 'n_words': 295}