Details
-
New Feature
-
Status: Resolved
-
Major
-
Resolution: Won't Do
-
7.10.x
-
None
-
None
Description
When reading data from hpcc and writing it to oracle I found that some fields containing odd characters had more bytes than the string field allowed.
STRING120 field company_name was returning strings that were 121 or 122 bytes long for field values like
'2005 MAXWELL LANE CONDOMINIUMS OWNERSÆ ASSOCIATION '
'RUBY�S BATH BOUTIQUE, INC. '
'VICTORIA�S SECRET STORES, LLC '
You can recreate this issue with the following code:
`````
@Test
public void byteWierdness() throws Exception
public void checkFile(HPCCFile file, Integer connectTimeoutMillis) throws Exception
{
if (file == null)
if (connectTimeoutMillis != null)
{ file.setFileAccessExpirySecs(connectTimeoutMillis/1000); } DataPartition[] fileParts = file.getFileParts();
if (fileParts == null || fileParts.length == 0)
FieldDef originalRD = file.getRecordDefinition();
if (originalRD == null || originalRD.getNumDefs() == 0)
ArrayList<HpccRemoteFileReader<HPCCRecord>> fileReaders = new ArrayList<HpccRemoteFileReader<HPCCRecord>>();
for (int i = 0; i < fileParts.length; i++)
{
try
catch (Exception e)
{
Throwable cause = e.getCause();
if (cause instanceof HpccFileException)
Assert.fail("Error constructing reader: " + e.getMessage());
}
}
for (int i = 0; i < fileReaders.size(); i++)
{
HpccRemoteFileReader<HPCCRecord> fileReader = fileReaders.get;
while (fileReader.hasNext())
{
HPCCRecord record = fileReader.next();
String companyname=(String)record.getField(1);
if (companyname != null && companyname.getBytes().length>120)
}
fileReader.close();
}
}
`````