返回首页

gbase数据、南大通用产品文档:GBase8a_gbase_hash_part_sample_method

更新日期:2024年09月11日

取值:[0|1]
默认值:0
说明:算子运算时one pass 切分更均匀优化,Group by 算子数据hash 划分时采样,
该参数用于控制采样方式,默认值为0。_gbase_hash_part_sample 参数打开时有效。
0 为按固定点位采样;
1 为按百分比采样。
固定点位采样20W 条数据全部采样,超过20W 条数据收集100 个采样点,采样时
间不超过300s。
修改方式:
可使用set 语句修改值也可在配置文件中修改值。
适用于session、
global
范围均可。


GBase 8s ESQL/C 编程指南
南大通用数据技术股份有限公司
- 653 -

示例
demo 目录中的文件 decround.ec 包含下列样例程序。
/*
* decround.ec *

The following program rounds a DECIMAL type number six times and displays the result
of each operation. */
#include

EXEC SQL include decimal;

char string[] = "-12345.038572";
char result[41];

main()
{
mint x;
mint i = 6; /* number of decimal places to start with */
dec_t num1;

printf("DECROUND Sample ESQL Program running.\n\n");

printf("String = %s\n", string);
while(i)
{
if (x = deccvasc(string, strlen(string), &num1))
{
printf("Error %d in converting string to DECIMAL\n", x);
break;
}
decround(&num1, i);
if (x = dectoasc(&num1, result, sizeof(result), -1))

GBase 8s ESQL/C 编程指南
南大通用数据技术股份有限公司
- 654 -
{
printf("Error %d in converting result to string\n", x);
break;
}
result[40] = '\0';
printf(" Rounded to %d Fractional Digits: %s\n", i--, result);
}
printf("\nDECROUND Sample Program over.\n\n");
}
输出
DECROUND Sample ESQL Program running.

String = -12345.038572
Rounded to 6 Fractional Digits: -12345.038572
Rounded to 5 Fractional Digits: -12345.03857
Rounded to 4 Fractional Digits: -12345.0386
Rounded to 3 Fractional Digits: -12345.039
Rounded to 2 Fractional Digits: -12345.04
Rounded to 1 Fractional Digits: -12345.

DECROUND Sample Program over.

DBMS 的身份鉴别功能分为两个部分:用户标识与身份鉴别。