C:\Users\admin\Desktop\view_code_pc\8-LinuxClientDemo - 副本\src\main\java\com\dwi\client\HCNetSDK.java java: 非法字符: '\ufeff'
时间: 2023-08-21 16:06:05 浏览: 33
这个错误通常是由于使用了 UTF-8 编码的文件头导致的,可以将文件头删除或者重新保存为不带文件头的 UTF-8 编码即可解决。你可以使用记事本打开该文件并在“文件”菜单下选择“另存为”,然后在“编码”选项中选择“UTF-8 无 BOM”即可。如果你使用的是其他编辑器,可以根据具体的编辑器找到相应的设置进行修改。
相关问题
#!/bin/sh un_config_day=`date +%Y%m01` #本月第一天 first_run_month=`date -d "${un_config_day} last day" +%Y%m` #上个月月份 config_day=`date -d "${day_id}" +%Y%m01` #设置月第一天 last_config_month=`date -d "${config_day} last day" +%Y%m` #设置月上个月月份 if [[ ${un_config_day} -eq ${config_day} ]];then nowmonth=$first_run_month else nowmonth=$last_config_month fi sleep 180 hive -e "select * from u_eda_lx_grp01.liugs_tmp_llzy_dpi_bytes_zj_cnt where month_id='${nowmonth}'" > /data1/u_eda_lx_grp01/lgs/llzy/dwi_db_dwi_in_2015_llzy_dpi_bytes_zj_cnt.dat sed -i 's/NULL//g' /data1/u_eda_lx_grp01/lgs/llzy/dwi_db_dwi_in_2015_llzy_dpi_bytes_zj_cnt.dat sed -i 's/\t/|@|/g' /data1/u_eda_lx_grp01/lgs/llzy/dwi_db_dwi_in_2015_llzy_dpi_bytes_zj_cnt.dat sleep 120 ftp -i -n<<! open 10.7.6.118 21 user infa 0jJ_rvom bin cd /ftpdata/receive/eda_in/in_2015/ lcd /data1/u_eda_lx_grp01/lgs/llzy prompt put dwi_db_dwi_in_2015_llzy_dpi_bytes_zj_cnt.dat close bye ! 这段代码什么意思
这段代码是一个Shell脚本,主要功能是将Hive中的数据导出到文件,然后通过FTP上传到远程服务器。
首先,通过`date`命令获取当前日期和月份。`un_config_day`表示本月的第一天,`first_run_month`表示上个月的月份。
接着,使用`date -d`命令将`day_id`转换为日期格式,并通过`last day`参数获取设置月份的上个月月份,保存在`last_config_month`变量中。
然后,使用条件判断语句判断本月第一天和设置月第一天是否相等。如果相等,则将`first_run_month`赋值给`nowmonth`变量;如果不相等,则将`last_config_month`赋值给`nowmonth`变量。
然后,脚本暂停执行180秒。
接下来,使用Hive命令从表`u_eda_lx_grp01.liugs_tmp_llzy_dpi_bytes_zj_cnt`中查询指定月份的数据,并将结果输出到文件`/data1/u_eda_lx_grp01/lgs/llzy/dwi_db_dwi_in_2015_llzy_dpi_bytes_zj_cnt.dat`。
然后,使用`sed`命令对文件进行处理,将其中的NULL字符串替换为空格,并将制表符替换为特殊字符串"|@|"。
然后,脚本再次暂停执行120秒。
最后,使用FTP命令连接到远程服务器,通过用户名和密码进行验证。然后切换到指定目录`/ftpdata/receive/eda_in/in_2015/`,设置本地目录为`/data1/u_eda_lx_grp01/lgs/llzy`,启用被动模式。接着,将文件`dwi_db_dwi_in_2015_llzy_dpi_bytes_zj_cnt.dat`上传到远程服务器。最后,关闭FTP连接。
这段代码的作用是将Hive表中指定月份的数据导出到文件,并通过FTP上传到远程服务器。
UPDATE a SET a.refund_status = b.dealstat , a.refund_time = b.dealtime FROM dwi_store_setmt_ord_dtl_p a INNER JOIN sdi_dgmps_dgmpsdb_mstore.chainstorefeemangdtl_p b ON a.comp_code = trim(upper(b.companycode)) AND a.src_pid = trim(b.pid) WHERE a.refund_status = 0 AND ISNULL(a.refund_time,'') = '' AND b.dealstat = 1 AND ISNULL(a.dealtime,'') <> '' ;改为用merge into 更新
Sure, here's the equivalent MERGE statement:
```
MERGE INTO dwi_store_setmt_ord_dtl_p AS a
USING (
SELECT trim(upper(b.companycode)) AS comp_code,
trim(b.pid) AS src_pid,
b.dealstat,
b.dealtime
FROM sdi_dgmps_dgmpsdb_mstore.chainstorefeemangdtl_p AS b
WHERE b.dealstat = 1
) AS b
ON a.comp_code = b.comp_code
AND a.src_pid = b.src_pid
AND a.refund_status = 0
AND ISNULL(a.refund_time, '') = ''
AND ISNULL(a.dealtime, '') <> ''
WHEN MATCHED THEN
UPDATE SET a.refund_status = b.dealstat,
a.refund_time = b.dealtime;
```
This MERGE statement combines the source table `sdi_dgmps_dgmpsdb_mstore.chainstorefeemangdtl_p` with the target table `dwi_store_setmt_ord_dtl_p` based on the matching conditions specified in the ON clause. When a match is found, the specified columns in the target table are updated with the corresponding values from the source table.