I'm looking at the output validation code, not Output, where there are no spaces at all on the right. It is a pity that there is confusion because of this!

 
Class codeGolf.test.Pyramid

I'll put in my five cents too.

Firstly, Apache for Windows is installed very easily: you just need to unpack the archive and, if necessary (this is done once), register the service.
Secondly, it is not difficult to find the Apache distribution for Windows, for example here: Apache Haus Downloads
Thirdly, I always remove PWS and use my own Apache, so I welcome removing PWS from the IRIS distribution

It is not entirely clear that you are using Caché or IRIS 2021.1:

#Caché

I have two tables: one a local table using cache and the other is via an SQL gateway..

Product version: IRIS 2021.1

The presence/absence of restrictions on the execution of heterogeneous queries depends on this:

Have you looked at the type of fields in the metadata?
For me, the INTEGER type (4) is returned for ID, and the BIGINT type (-5) is returned for %ID.

Try

SELECT idxyFROM some_table order by %id

and

rs.%GetMetadata().%Display()

What are the default values for AdaptiveMode, AllowRowIDUpdate, IdKeyCPF, PKEY_IS_IDKEY ?

Try disabling AdaptiveMode.

There is a faster way without opening the object:

Class dc.test Extends %Persistent
{

ClassMethod Test()
{
  
  classname="dc.test"storagename="Default"
  w $$$defMemberKeyGet(classname,$$$cCLASSstorage,storagename,$$$cSDEFdatalocation)
}

Storage Default
{
<Data name="testDefaultData">
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
</Data>
<DataLocation>^abc.1</DataLocation>
<DefaultData>testDefaultData</DefaultData>
<IdLocation>^dc.testD</IdLocation>
<IndexLocation>^dc.testI</IndexLocation>
<StreamLocation>^dc.testS</StreamLocation>
<Type>%Library.CacheStorage</Type>
}

}

Result:

^abc.1

Here are two ways:

s="12162,CHAPTER I,Certain infectious and parasitic diseases (A00-B99),003 (A20-A28),Certain zoonotic bacterial diseases,A28,""Other zoonotic bacterial diseases, not elsewhere classified"",A28,""Other zoonotic bacterial diseases, not elsewhere classified"",N,N,N,N,N,,,,,,,,,,G"
##class(%DeepSee.TermList).%ParseCSVRecord(s,.arr1)
zw arr1

!

list=$$CSVtoList^%occLibrary(s)

##class(%ListOfDataTypes).BuildValueArray(list,.arr2)
zw arr2


Take a look at the class methods %SQL.Util.Procedures

If there was a built-in function for expanding the list into a table, then the solution would be even shorter.

 
An example of such a function:

Now you can do a variety of things with the string, for example:

select min(length(word)) "min",length(wordlen,word from dc_golf.Kata_split('bitcoin take over the world maybe who knows perhaps',' ')

Result:

min len word
3 7 bitcoin
3 4 take
3 4 over
3 3 the
3 5 world
3 5 maybe
3 3 who
3 5 knows
3 7 perhaps

There are no such methods, because the size of the stream (file) can exceed the maximum length of the string, which at the moment is 3641144, so the type of string (%String, %VarString, %xsd.base64Binary, etc.) will not always be able to hold all the data.

But also it is not difficult to read the stream into a line:

ClassMethod StreamToStr(ByRef stream As %Stream.ObjectAs %String
{
  s=""
  stream.Rewind()
  while 'stream.AtEnd {
    s=s_stream.Read($$$MaxLocalLength)
  }
  s
}

PS: above I have given methods, some of which are available in older versions of Caché.