本文整理汇总了C++中OwnedHqlExpr::getLink方法的典型用法代码示例。如果您正苦于以下问题:C++ OwnedHqlExpr::getLink方法的具体用法?C++ OwnedHqlExpr::getLink怎么用?C++ OwnedHqlExpr::getLink使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OwnedHqlExpr
的用法示例。
在下文中一共展示了OwnedHqlExpr::getLink方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: buildWorkUnitViewerEcl
IHqlExpression * buildWorkUnitViewerEcl(IHqlExpression * record, const char * wuid, unsigned sequence, const char * name)
{
OwnedHqlExpr newRecord = createSymbol(createIdentifierAtom("_SourceRecord_"), LINK(record), ob_private);
IHqlExpression * arg = name ? createConstant(name) : createConstant((int)sequence);
OwnedHqlExpr dataset = createDataset(no_workunit_dataset, newRecord.getLink(), createComma(createConstant(wuid), arg));
OwnedHqlExpr projected = addSimplifyProject(dataset);
OwnedHqlExpr output = addOutput(projected);
return output.getClear();
}
示例2: createBrowseWU
bool QueryDataSource::createBrowseWU()
{
StringAttr dataset, datasetDefs;
StringAttrAdaptor a1(dataset), a2(datasetDefs);
wuResult->getResultDataset(a1, a2);
if (!dataset || !datasetDefs)
return false;
StringBuffer fullText;
fullText.append(datasetDefs).append(dataset);
OwnedHqlExpr parsed = parseQuery(fullText.str());
if (!parsed)
return false;
HqlExprAttr selectFields = parsed.getLink();
if (selectFields->getOperator() == no_output)
selectFields.set(selectFields->queryChild(0));
OwnedHqlExpr browseWUcode = buildQueryViewerEcl(selectFields);
if (!browseWUcode)
return false;
returnedRecord.set(browseWUcode->queryChild(0)->queryRecord());
StringAttr tempAttr;
StringAttrAdaptor temp(tempAttr);
Owned<IWorkUnitFactory> factory = getWorkUnitFactory();
Owned<IConstWorkUnit> parent = factory->openWorkUnit(wuid, false);
SCMStringBuffer user;
StringAttrAdaptor acluster(cluster);
parent->getClusterName(acluster);
parent->getUser(user);
Owned<IWorkUnit> workunit = factory->createWorkUnit(NULL, "fileViewer", user.str());
workunit->setUser(user.str());
workunit->setClusterName(cluster);
workunit->setCustomerId(parent->getCustomerId(temp).str());
workunit->setCompareMode(CompareModeOff); // ? parent->getCompareMode()
StringAttrAdaptor bwa(browseWuid); workunit->getWuid(bwa);
workunit->setDebugValueInt("importImplicitModules", false, true);
workunit->setDebugValueInt("importAllModules", false, true);
workunit->setDebugValueInt("forceFakeThor", 1, true);
StringBuffer jobName;
jobName.append("FileView for ").append(wuid).append(":").append("x");
workunit->setJobName(jobName.str());
StringBuffer eclText;
toECL(browseWUcode, eclText, true);
Owned<IWUQuery> query = workunit->updateQuery();
query->setQueryText(eclText.str());
query->setQueryName(jobName.str());
return true;
}
示例3: buildDiskFileViewerEcl
IHqlExpression * buildDiskFileViewerEcl(const char * logicalName, IHqlExpression * record)
{
//Add filepos to the incomming record structure...
IHqlExpression * filePosAttr = createAttribute(virtualAtom, createAttribute(filepositionAtom));
OwnedHqlExpr filepos = createField(fileposName, makeIntType(8, false), NULL, filePosAttr);
IHqlExpression * sizeofAttr = createAttribute(virtualAtom, createAttribute(sizeofAtom));
OwnedHqlExpr reclen = createField(recordlenName, makeIntType(2, false), NULL, sizeofAttr);
HqlExprArray fields;
unwindChildren(fields, record);
fields.append(*filepos.getLink());
fields.append(*reclen.getLink());
OwnedHqlExpr newRecord = createRecord(fields);
newRecord.setown(createSymbol(createIdentifierAtom("_SourceRecord_"), newRecord.getLink(), ob_private));
OwnedHqlExpr dataset = createNewDataset(createConstant(logicalName), newRecord.getLink(), createValue(no_thor), NULL, NULL, NULL);
OwnedHqlExpr filtered = addFilter(dataset, filepos);
OwnedHqlExpr projected = addSimplifyProject(filtered);
OwnedHqlExpr output = addOutput(projected);
return output.getClear();
}